Bob has a strange counter. At the first second, it displays the number . Each second, the number displayed by the counter decrements by until it reaches .
The counter counts down in cycles. In next second, the timer resets to and continues counting down. The diagram below shows the counter values for each time in the first three cycles:
Find and print the value displayed by the counter at time .
Complete the strangeCounter function in the editor below. It should return the integer value displayed by the counter at time .
strangeCounter has the following parameter(s):
A single integer denoting the value of .
Print the value displayed by the strange counter at the given time .
Time marks the beginning of the second cycle. It is double the number displayed at the beginning of the first cycle:. This is also shown in the diagram in the Problem Statement above.