Company: Infosys
Difficulty: medium
Steps to Zero You are given a positive integer N, which you must reduce to zero one operation at a time. On each turn, apply whichever of the following rules is the first to match the current value of N: If N is a multiple of 5, divide it by 5. Otherwise, if N is a multiple of 3, divide it by 3. Otherwise, if N is a multiple of 2, divide it by 2. Otherwise, subtract 1 from N. Determine the total number of operations required for N to reach zero. Function Description Complete the countSteps function with the following parameter(s): Name Type Description N INTEGER The given integer. Return: The function must return an INTEGER denoting the number of steps needed to make N zero. Constraints 1 ≤ N ≤ 10 6 Sample Test Cases Input: 6 Output: 3 Turn 1: 6 is a multiple of 3 (not of 5), so divide by 3, giving N=2 Turn 2: 2 is a multiple of 2 (not of 5 or 3), so divide by 2, giving N=1 Turn 3: 1 is not a multiple of 5, 3, or 2, so subtract 1, giving N=0 Reaching zero took 3 turns in total, so the