같은 숫자는 싫어
function solution(arr) { var answer = []; var compareValue = arr[0]; answer.push(compareValue); for (var i = 1; i < arr.length; i++) { if (compareValue != arr[i]) { compareValue = arr[i]; answer.push(arr[i]); } } return answer; }