Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //let input =['c','c','a','b','a','a','b','c'];
- let input =['1','2','2','2','2','18','3','12'];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- let resultArr =[];
- for (let i = 0 ;i< input.length;i++) {
- let element =gets();
- if(resultArr.includes(element)){
- continue;
- }
- resultArr.push(element);
- }
- print(resultArr.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement