You are viewing a single comment's thread. Return to all comments →
Python
@functools.lru_cache(None) def PG(arr): if list(arr) == sorted(list(arr)): return 'Bob' else: for i in range(len(arr)): if PG(arr[:i]+arr[i+1:]) == 'Bob': return 'Alice' return 'Bob' def permutationGame(arr): return PG(tuple(arr))
Seems like cookies are disabled on this browser, please enable them to open this website
Permutation game
You are viewing a single comment's thread. Return to all comments →
Python