Advertisement
CR7CR7

arrsearch

Sep 23rd, 2022
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const input = [
  2.     '1,1,1,1,1,1,1,1'
  3. ];
  4.  
  5. let print = this.print || console.log;
  6. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  7.  
  8.  
  9.  
  10.  
  11. let arrInput = gets().split(',').map(Number);
  12.  
  13. let notPresent = [];
  14.  
  15. let len = arrInput.length;
  16.  
  17. for (let i = 1; i < arrInput.length + 1; i++) {
  18.     if (!arrInput.includes(i)) {
  19.         notPresent.push(i);
  20.     }
  21. }
  22.  
  23. print(notPresent.join(','));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement