import java.util.*;
public class Solution {
public int[] solution(int []arr) {
ArrayList<Integer> tt = new ArrayList<>();
int temp = -97;
for(int i=0 ; i<arr.length ; i++) {
if(temp != arr[i]) {
tt.add(arr[i]);
//answer[answer.length] = arr[i];
temp = arr[i];
}
else {
}
}
int[] answer = new int[tt.size()];
for(int i=0 ; i<tt.size() ; i++) {
answer[i] = tt.get(i);
}
return answer;
}
}