Want to work with Philips? Good to know!
Want to work with Philips? Good to know!
LANGUAGES
LANGUAGES
Pick your language for the challenge
Pick your language for the challenge
C
Clojure
C++
C++14
C#
Erlang
Go
Haskell
Java 7
Java 8
Javascript
Julia
Kotlin
Lua
Objective-C
Perl
PHP
PyPy
PyPy3
Python 2
Python 3
R
Ruby
Scala
Swift
C
Clojure
C++
C++14
C#
Erlang
Go
Haskell
Java 7
Java 8
Javascript
Julia
Kotlin
Lua
Objective-C
Perl
PHP
PyPy
PyPy3
Python 2
Python 3
R
Ruby
Scala
Swift
The Challenges In Detail
The Challenges In Detail
Equal Circle Segments
Given the radii of a number of circles and a number of equal area segments to cut, determine the largest area that each segment can cover. Each segment must be cut from a single circle.
Note: Use 3.14159265359 as the value of pi and return the answer rounded to 4 places after the decimal. The answer is accepted if the absolute error is within 10-4 i.e (1e-4).
Example:
n = 6
radius = [1, 1, 1, 2, 2, 3]
numberOfSegments = 6
There need to be 6 equal size segments cut. The area of a circle with radius r is calculated as (pi * radius * radius).
- For radii 1, 2 and 3, the areas are 3.14159265359, 12.5663706156, and 28.2743338851 units2.
- It would be possible to create enough segments that match the area of the circles with radius 1, but that would not be the biggest segment size possible.
- The best way to cut the circles is to cut the largest circle into 4 segments (area = 28.743338851 / 4 = 7.068583471275) and a similar size segment from each of the circles with radius 2.
- The answer is 7.0686.
Language Stats
Language | Candidates | Median Score % | Max Score Attained | Median Time taken |
---|---|---|---|---|
C | 1,217 | 0 | 75 | 13m |
Python 3 | 1,115 | 1 | 75 | 27m |
C++ | 858 | 0 | 75 | 22m |
Java 8 | 651 | 0 | 75 | 26m |
C++14 | 336 | 1 | 75 | 29m |
JavaScript (Node.js) | 213 | 1 | 75 | 54m |
C# | 128 | 0 | 75 | 37m |
Python 2 | 84 | 0 | 75 | 15m |
PHP | 47 | 1 | 75 | 35m |
Ruby | 32 | 0 | 75 | 17m |
PyPy3 | 22 | 0 | 75 | 18m |
PyPy | 4 | 1 | 75 | 39m |
Swift | 37 | 1 | 37 | 50m |
Java 7 | 421 | 0 | 30 | 27m |
Go | 2 | 3 | 6 | 16m |
Kotlin | 10 | 0 | 3 | 40m |
Objective-C | 1 | 3 | 3 | 1h 59m |
R | 3 | 0 | 1 | 10m |
Scala | 1 | 0 | 0 | 8m |
Equal Circle Segments
Given the radii of a number of circles and a number of equal area segments to cut, determine the largest area that each segment can cover. Each segment must be cut from a single circle.
Note: Use 3.14159265359 as the value of pi and return the answer rounded to 4 places after the decimal. The answer is accepted if the absolute error is within 10-4 i.e (1e-4).
Example:
n = 6
radius = [1, 1, 1, 2, 2, 3]
numberOfSegments = 6
There need to be 6 equal size segments cut. The area of a circle with radius r is calculated as (pi * radius * radius).
- For radii 1, 2 and 3, the areas are 3.14159265359, 12.5663706156, and 28.2743338851 units2.
- It would be possible to create enough segments that match the area of the circles with radius 1, but that would not be the biggest segment size possible.
- The best way to cut the circles is to cut the largest circle into 4 segments (area = 28.743338851 / 4 = 7.068583471275) and a similar size segment from each of the circles with radius 2.
- The answer is 7.0686.
Language Stats
Language | Candidates | Median Score % | Max Score Attained | Median Time taken |
---|---|---|---|---|
C | 1,217 | 0 | 75 | 13m |
Python 3 | 1,115 | 1 | 75 | 27m |
C++ | 858 | 0 | 75 | 22m |
Java 8 | 651 | 0 | 75 | 26m |
C++14 | 336 | 1 | 75 | 29m |
JavaScript (Node.js) | 213 | 1 | 75 | 54m |
C# | 128 | 0 | 75 | 37m |
Python 2 | 84 | 0 | 75 | 15m |
PHP | 47 | 1 | 75 | 35m |
Ruby | 32 | 0 | 75 | 17m |
PyPy3 | 22 | 0 | 75 | 18m |
PyPy | 4 | 1 | 75 | 39m |
Swift | 37 | 1 | 37 | 50m |
Java 7 | 421 | 0 | 30 | 27m |
Go | 2 | 3 | 6 | 16m |
Kotlin | 10 | 0 | 3 | 40m |
Objective-C | 1 | 3 | 3 | 1h 59m |
R | 3 | 0 | 1 | 10m |
Scala | 1 | 0 | 0 | 8m |
© 2019 | CODEMOTION | VAT IT12392791005 info@codemotionworld.com PRIVACY POLICY. The prizes can under no circumstance be converted into cash. Codemotion reserves the right to change any and all terms of her promotions without prior notification.