Leap Tools interview question

a hard level coding question