Hello all, I'm currently struggling in this question, and cannot seem to find a direction in which I should approach this question. This question was asked in an online assessment on hackerrank yesterday. Any help or direction in which I should tackle this will be really greatful! Thanks.
Edit 1. I've mentioned my thought process as of yet in the comments.
Edit 2. Also, before downvoting, can you please mention the reason, so that I can learn what part of this blog I posted is causing the trouble, thanks.