[3, 2, 2, 4] 1 1 0 0 1 1 1 3