You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider Aman is visiting Nehru Zoo. She has seen there are N elephants standing in a row. She wants to remove the elephants having the same height standing in consecutive.Write a program for Aman so that she can get the desired sequence of elephants.
3
+
4
+
Input Format
5
+
6
+
The first line will be containing one Integer representing a number of elephants N.
7
+
The second line will contain N integers representing the heights of the elephants.
8
+
9
+
Constraints
10
+
11
+
N>2 && N<30
12
+
13
+
Output Format
14
+
15
+
The desired sequence of elephants after removing elephants having the same height standing in consecutive.
0 commit comments