CB numbers alternate solution

I have solved the problem and getting correct test case results but I wanted to know if there is another way to solve this problem as I have just applied brute force method.

Hey @shubham53.sg have seen your submission for the problem. And as far as i know. It’s the only way to solve this problem. That’s why you git 100 cause if you would have applied anything else then result would have been TLE or WA cause test cases are tight.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.