Find the Losers of the Circular Game Problem
Find the Losers of the Circular Game Problem — ExecCode Easy DSA Practice
Solve the Find the Losers of the Circular Game problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given the number of friends, n, and an integer k, return the array answer, which contains the losers of the game in the ascending order. Your task is to there are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the i^th friend brings you to the (i+1)^th friend for 1 <= i < n, and moving clockwise from the n^th friend brings you to the 1^st friend. The rules of the game are as follows:. Return the required answer exactly as shown in the examples.
Examples
Input {"n": 5, "k": 2}; Output [4, 5]. Input {"n": 4, "k": 4}; Output [2, 3, 4]
Constraints
1 <= k <= n <= 50
Practice Find the Losers of the Circular Game free on ExecCode. Browse DSA problems, topic map, and placement guides.