https://practice.geeksforgeeks.org/problems/bbt-counter/0