M items are to be delivered in a circle of size N. Find the position where the M-th item will be delivered if we start from a given position K. Note that items are distributed at adjacent positions starting from K.
Input:N = 5, M = 2, K = 1Output:2Explanation:If we start from 1st position, the
2nd item will land at the 2nd position.
Input:N = 5, M = 8, K = 2Output:4Explanation:If we start from 2nd position, the
8th item will land at the 4th position.
You don't need to read input or print anything. Your task is to complete the function findPosition() which takes 3 Integers N,M and K as input and returns the answer.
Expected Time Complexity: O(1) Expected Auxiliary Space: O(1)