This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_last_index(n, m, x) | |
return nil if x > m # nil if received invalid input | |
last_person_index = -1 | |
while m > 0 do | |
m -= x | |
m > x ? x += 1 : x = m | |
last_person_index == n-1 ? last_person_index = 0 : last_person_index += 1 | |
end | |
return last_person_index | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1033edge.com | |
11mail.com | |
123.com | |
123box.net | |
123india.com | |
123mail.cl | |
123qwe.co.uk | |
150ml.com | |
15meg4free.com | |
163.com |