We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Save the Prisoner!
Save the Prisoner!
Sort by
recency
|
1695 Discussions
|
Please Login in order to post a comment
C# return (m+s-1) > n ?(((m+s-1)%n) == 0 ? n:(m+s-1)%n ):(m+s-1);
Here solution in c++, you can watch the explanation here : https://youtu.be/xoV2P0Pv9Fg
Solution 1 :
Solution 2 :
def saveThePrisoner(n, m, s):