Number of ZigZag Arrays III
Count arrays whose neighbours differ and whose steps alternate up and down, tracking the last step for every value.
Count arrays whose neighbours differ and whose steps alternate up and down, tracking the last step for every value.