2665. Counter II - Explanation

Problem Link