Pair programming problem I completed during a job interview