Crawler Log Folder - minimum number of operations needed to go back to the main folder after the change folder operations.
Problem The Leetcode file system keeps a log each time some user performs a…
August 31, 2019
This problem is a simple mathematical calculation. Lets start deriving some equations. Note: Here we are talking about the round clock, which displays 1-12 hours.
A complete round of a clock is equal to 360 degree angle. This is simple, minute hand complete 360 degree in 60 minutes. Or, it takes 60 minutes to complete 360 degree
60 M -> 360 degree
1 M -> 360/60 -> 6 degree
Means, minute hands moves 6 degree per minute.
For 'M' minutes, it will be 6 * M degree
Hour hand takes 12 hours to complete a round i.e. 360 degree. But, if you notice. When hour hand moves, there will be a movement in minute hand too, due to that hour hand will move to some extent.
For hour hand:
12 Hours -> 360 degree
1 Hour -> 360/12 -> 30 degree
For 'H' Hours -> 30 * H degree
And, there will be some movement in minute hand too. Continuing above equation:
12 Hours -> 360 degree
12 * 60 Minutes -> 360 degree
1 Minute -> 360 / (12 * 60) -> 1/2 degree
In 'M' minuets -> M/2 degree
Combining them, Angle of hour : 30 H + M/2
As from above equations:
Angle of Hour hand - Angle of Minute hand
=> (30 H + M/2) - (6 M)
=> 30 H - 5.5 M
Angle at time: 6:15
30 H - 5.5 M
=> 30 * 6 - 5.5 * 15
=> 180 - 82.5
=> 97.5
Problem The Leetcode file system keeps a log each time some user performs a…
Problem Statement Given n non-negative integers a1, a2, …, an , where each…
Problem Statement Given a signed integer, reverse digits of an integer. Return…
A number consists of digits. Example: 843. Its a 3-digit number. Radix sort…
Young Tableau A a X b matrix is Young Tableau if all rows(from left to right…
Min Priority Queue is a data structure which manage a list of keys(values). And…
In this post, we will see some of the frequently used concepts/vocabulary in…
System design interview is pretty common these days, specially if you are having…
Introduction You are given an array of integers with size N, and a number K…
Graph Topological Sorting This is a well known problem in graph world…
Problem Statement Given a Binary tree, print out nodes in level order traversal…
Problem Statement Given an array nums of n integers and an integer target, are…