Swap two integers until you cannot.
Anonymous
use a for loop and compare the current element to element to right (-1) to avoid out of bounds, and use a while loop to do this to check with a boolean flag. Time Complexity is N ^ 2. I offered to optimize, but the interviewer declined.
Check out your Company Bowl for anonymous work chats.