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.
defmisereNim(s)# Write your code heretotal_xor=0;total=0;s.each_indexdo|i|total_xor^=s[i];total+=s[i];endif(s.size%2==0)returns.size!=total&&total_xor==0?"Second":"First";elsereturns.size==total||total_xor==0?"Second":"First";endend
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Misère Nim
You are viewing a single comment's thread. Return to all comments →
Ruby solution: