question - https://www.interviewbit.com/problems/sum-root-to-leaf-numbers/
my code - https://ide.geeksforgeeks.org/NRWNopeYHn
error on interviewbit platform-
run time error
terminate called after throwing an instance of ‘std::out_of_range’
what(): stoi
Aborted
Sum root to leaf numbers stoi error
stoi function won’t work for large strings because this will exceed the range of integer itself. Try converting the string to integer yourself while taking mod 1003 at each step so that it never exceeds the range.