Ahh... I was still accessing bstring[i] instead of bstring[0]. It passes
all 3 test cases now. Thank you so much for you help!
On Monday, April 13, 2020 at 5:14:50 PM UTC-4, porker2008 wrote:
>
> for some reason, your code passed all 3 tests in my submissions after the
> trim() was fixed.
>
>
for some reason, your code passed all 3 tests in my submissions after the
trim() was fixed.
Maybe our submissions are run against different test data?
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop
Thank you! I will be aware of nested variables like that. I see the issue
with substr() too: it was lopping off more than just the first element in
some cases. Thanks for that. The code passes Test set 1 and 2 now. It gives
a WA on Test Set 3. Thoughts?
On Monday, April 13, 2020 at 4:52:51 PM
your trim function is not working properly.
To fix it, you can try
*string trim(string bstring) {*
* for (int i = 0; i < 1000; ++i) {*
* if (bstring[0] == '0') bstring = bstring.substr(1);*
* else return bstring;*
* }*
* return bstring;*
*}*
Also you have nested loop reusing loop variable *i*,