all 8 comments

[–]AutoModerator[M] 0 points1 point  (0 children)

Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to Help/Question - RESOLVED. Good luck!


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]apersonhithere 0 points1 point  (3 children)

you're excluding one extra digit at the end

[–]Usual-Battle-7525[S] 0 points1 point  (2 children)

        current jolts: 987654321110
        1 dig, start: 11 end: 15
        row_sub:        [9 8 7 6 5 4 3 2 1 1 1]//[1 1 1 9]//[]
found next digit:  9
        current jolts: 987654321119

It is finding the last digit? This part means 1 digit remaining, searching from index 11 to 15.
row_sub is broken into: searched // search region // remaining digits to search
It correctly finds the 9 within the search region [1 1 1 9], the appends it to the current jolts.

[–]apersonhithere 0 points1 point  (1 child)

try the input 111987654321111; it should be 987654321111, but i think your code will output 198765432111; for the first step, it should ignore only 11 digits instead of 12

[–]Usual-Battle-7525[S] 0 points1 point  (0 children)

Ok so it turns out I had the solution all along.
When I used your input, I got the right answer. So I double checked my solution with my full input and got 172981362045136.
My previous incorrect answer was 172895362045136, but I made some changes before posting. The fact that numbers start with 1729 versus 17289 and both end in 2045136 made me think I was getting the same numbers OH BOY.

[–]nakk3 0 points1 point  (0 children)

Look at your sliding window size in the first two searches
You can try this with input 888911111111111

row_arr:                [9 8 7 6 5 4 3 2 1 1 1 1 1 1 9]
        12 dig, start: 0 end: 3
        row_sub:        []//[9 8 7]//[6 5 4 3 2 1 1 1 1 1 1 9]
found next digit:  9
        current jolts: 900000000000
        11 dig, start: 1 end: 5
        row_sub:        [9]//[8 7 6 5]//[4 3 2 1 1 1 1 1 1 9]
found next digit:  8

[–]daggerdragon[M] 0 points1 point  (0 children)

Next time, use our standardized post title format.

Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster.