• + 3 comments

    Hi. I added a detailed answer to your question in my original post. Hopefully it helps, it was tough to explain.

    HackerRank solutions.