Overflow of ans


somebody help me my answer got overflow every time. i calculated sum for a,e,i,o,u and add them like
ans = (a%c + e%c+ i%c + o%c + u%c + c)%c where c is 1e9 + 7


Make your variables long then type cast your ans to int when you return;


Thanks for your reply this problem is from codorbit section problem’s name is Vowels


It is from codersbit so?


i have taken long long type but for A>= 58 long long gets overflow.


i revised my modular arithmetic concepts. and i found my bug. so don’t bother to reply.