Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve (arr) {
- let countSongs = arr.shift();
- let typeOflist = arr.pop();
- // class Song {
- // constructor (typeList, name, time) {
- // this.typeList = typeList;
- // this.name = name;
- // this.time = time;
- // }
- // }
- for (let i = 0; i < countSongs; i++) {
- let curr = arr[i].split('_');
- // console.log(curr);
- if (curr[0] === typeOflist) {
- console.log(curr[1]);
- } else if (typeOflist === 'all') {
- console.log(curr[1]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement