Case 1: 3 2 2 5 2 7 4 Case 2: 0