The explanation of the solution approach for this problem (as well as many others on InterviewBit) is really poor. It’s almost like someone took 1 minute to write it and only made sure it was clear to themselves and didn’t ask anyone else if it was clear before posting it.
Agreed. It’s written very poorly. I had to try few test cases in expected solution before it started making any sense.
Agreed. Someone else should at least review.