• + 1 comment

    Easy to understand: don't update the array to overflow memory, just use some var for last_val