Leap Tools Interview Question

a hard level coding question