My code gives wrong ans....but i think it should work fine
hello @aakashkumarjee

use long long for carry and mul
use this statement in place of mul*=2
mul=(mul%3 * 2%3 )%3
do same with carray as well.
(a+b) %mod =(a%mod + b%mod)%mod
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.