Advertisement
Guest User

Untitled

a guest
May 31st, 2020
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const input = ['1,2,3,3,5'];
  2.  
  3. const gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  4. const print = this.print || console.log;
  5.  
  6. let arr = gets().split(',').map((e) => +e);
  7. let indexes = arr.map((e, i) => i + 1);
  8.  
  9. let result = indexes.filter(x => !arr.includes(x)).join(',');
  10.  
  11. print(result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement