You are viewing a single comment's thread. Return to all comments →
One line solution :)
return k < n/2 ? (2*k + 1) : 2*(n - k - 1)
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse Game
You are viewing a single comment's thread. Return to all comments →
One line solution :)
return k < n/2 ? (2*k + 1) : 2*(n - k - 1)