Guest User

Untitled

a guest
Sep 26th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function solution(participant, completion) {
  2. for (leti = 0; i < participant.length; i++) {
  3. if (completion.includes(participant[i])) {
  4. let value = participant[i];
  5. participant.splice(i, 1);
  6. completion.splice(completion.indexOf(value), 1);
  7. i--;
  8. }
  9. }
  10. return participant.join('');
  11. }
  12.  
  13. let participant = ['marina', 'josipa', 'nikola', 'vinko', 'filipa'];
  14. let completion = ['josipa', 'filipa', 'marina', 'nikola'];
  15.  
  16. console.log(solution(participant, completion))
Add Comment
Please, Sign In to add comment