Findem interview question

leet code or hackerrank style question