Advertisement
Guest User

Untitled

a guest
Sep 25th, 2020
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. let firstList = gets().replace(',', '').split('').map(Number);
  2. let secondList = gets().replace(',', '').split('').map(Number);
  3. let combinedLists = [];
  4. for (let i = 0; i < firstList.length; i++) {
  5. combinedLists.push(firstList[i], secondList[i]);
  6. }
  7. print(combinedLists.filter(function(element){
  8. return !Number.isNaN(element);
  9. }).join(','))
  10.  
  11. // Код 2 започва от тук надолу
  12.  
  13. let firstList = gets();
  14. let secondList = gets();
  15. let combinedLists = [];
  16. for (let i = 0; i < firstList.length; i++) {
  17. combinedLists.push(firstList[i], secondList[i]);
  18. }
  19. combinedLists = combinedLists.toString().replace(/,/g, '');
  20. print(combinedLists.toString().split('').join(','));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement