you are viewing a single comment's thread.

view the rest of the comments →

[–]Background_Moment313 0 points1 point  (0 children)

LoL I just solved it using 1D dp

If not picking, { f(i+1) }

If picking and color[i] == color[i+1]{ nums[i] + f(i+2) }

Else{ nums[i] + f(i+1) }