Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
========Iteration: 0 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-2]
max: 4
========Iteration: 1 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-2, -1]
max: 4
========Iteration: 2 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4]
max: 4
========Iteration: 3 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, 0]
max: 4
========Iteration: 4 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1]
max: 4
========Iteration: 5 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1, 1]
max: 5
========Iteration: 6 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -1, 1, 2]
max: 6
========Iteration: 7 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -3]
max: 6
========Iteration: 8 ========
[-2, -1, -4, 0, -1, 1, 2, -3, 1]
^
Stack: [-4, -3, 1]
max: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.