Company: Standard chartered gbs exam

Difficulty: medium

Problem Statement

Channel Deletion There are `N` television channels arranged in a circle. In the circle, the channel after `i` is `i + 1`, and the channel after `N` is `1`. Starting from channel `1`, repeatedly count `K` currently available channels clockwise and delete the channel where the count ends. Continue counting from the next available channel. When only one channel remains, print its **zero-based position** in the original circular ordering. Input Format The input contains two space-separated integers `N` and `K`. Output Format Print the zero-based position of the final remaining channel. Example Input: `5 2` Output: `2` With five channels and a step of two, the Josephus recurrence gives final zero-based position `2`. Constraints `1 <= N <= 1000000000` `1 <= K <= 1000000000` Notes The submitted image labels channels from `1` to `N`, but its shown input `5 2` has output `2`. A one-based survivor would be `3`; therefore this standalone contract intentionally returns the zero-based s

More Standard chartered gbs exam OA questionsInterview experiences