Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solution(participant, completion) {
- for (leti = 0; i < participant.length; i++) {
- if (completion.includes(participant[i])) {
- let value = participant[i];
- participant.splice(i, 1);
- completion.splice(completion.indexOf(value), 1);
- i--;
- }
- }
- return participant.join('');
- }
- let participant = ['marina', 'josipa', 'nikola', 'vinko', 'filipa'];
- let completion = ['josipa', 'filipa', 'marina', 'nikola'];
- console.log(solution(participant, completion))
Add Comment
Please, Sign In to add comment