Microsoft Interview Question

it was an easy algorithm question on the whiteboard