Interview Q: find angle between hour and minute hands in an analog clock
- by polygenelubricants
I was given this interview question recently:
An analog clock shows that the current time is HH:MM. Compute in degree, the smaller angle between the hour and minute hands. Be as precise as you can.
I'm wondering what's the simplest, most readable, most precise algorithm is. Solution in any language is welcome (but do explain it a bit if you think it's necessary).