Findem Interview Question

leet code or hackerrank style question