Puzzel interview question

Walk us through your solution to the technical task