Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30 - circleOfNumbers #55

Closed
Tracked by #40
ValdineiJunior opened this issue Jul 8, 2023 · 0 comments
Closed
Tracked by #40

30 - circleOfNumbers #55

ValdineiJunior opened this issue Jul 8, 2023 · 0 comments

Comments

@ValdineiJunior
Copy link
Owner

ValdineiJunior commented Jul 8, 2023

circleOfNumbers

Consider integer numbers from 0 to n - 1 written down along the circle in such a way that the distance between any two neighboring numbers is equal (note that 0 and n - 1 are neighboring, too).

Given n and firstNumber, find the number which is written in the radially opposite position to firstNumber.

Example

For n = 10 and firstNumber = 2, the output should be
solution(n, firstNumber) = 7.

Click here - and see my solution in replit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant