You are viewing a single comment's thread. Return to all comments →
Simple java Solution
long poisoned = (startID + sweets - 1) % noPrisoners; if(poisoned == 0) poisoned = noPrisoners; System.out.println(poisoned);
Seems like cookies are disabled on this browser, please enable them to open this website
Save the Prisoner!
You are viewing a single comment's thread. Return to all comments →
Simple java Solution