Skip to content

Commit 38caeb1

Browse files
Merge pull request #91 from wakidurrahman/feat/code-challenges-003
feat: simpleClockAngle
2 parents c7e85f6 + a1863dc commit 38caeb1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Q003: Simple clock angle
3+
* Problem
4+
* You will be given a number N that represents where the minute hand currently is on a clock.
5+
* Your program should return the angle that is formed by the minute hand and the 12 o'clock mark on the clock.
6+
*/
7+
8+
function simpleClockAngle(number) {
9+
// we got 6 because 360(degree)/60(minute) = 6;
10+
// 360 represents the full number of a degrees in a circle and
11+
// 60 is the number of minutes on a clock, so dividing these two numbers
12+
// gives us the number of degrees for one minute
13+
return 6 * number;
14+
}

0 commit comments

Comments
 (0)