Count the given numbers on your fingers and find the correct finger on which the number ends.
The first number starts from the thumb, second on the index finger, third on the middle finger, fourth on the ring finger and fifth on the little finger.
Again six comes on the ring finger and so on.
N = 3Output:
3 ends on the finger 3.
N = 6Output:
6 ends on the finger 4.
You don't need to read input or print anything. Your task is to complete the function fingerCount() which takes an integer N as input parameter and returns the finger number on which this number ends.
Expected Time Complexity: O(1) Expected Auxiliary Space: O(1)