ABX01 - EDITORIAL

i got the mistake. cout<<y<<endl; instead of cout<<a<<endl;. BTW i have not considered n=0 as per constrained.
Thanks a lot.

after reading the comment of @pk301 i realized that it is O(no of digits) i didn’t do a proper analysis sorry saw you solution it is actually O(1) well done

well done @eugalt if any one didn’t get % 9 part the can look the comment of @sideralis nice explanation both of you @eugalt your code is very well represented.

thanks a lot @ayan_nitd for second test case. I found the mistake(18,0 is not a valid testcase)

O(no of digits) is O(log N).

Why my code is giving WA. I solved using digital root
https://www.codechef.com/viewsolution/36157204