2620. Counter - Explanation

Problem Link