• + 0 comments

    To solve this question, you do not need any loop at all. it can be solved in O(1) time

    I hope this comment will help you to opmtize your solution further.-

    https://www.hackerrank.com/challenges/kangaroo/forum/comments/585778