Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function travelling(input) {
- let country=input.shift()
- while(country !="End"){
- let needMoney=Number(input.shift());
- while (needMoney>0){
- let savedMoney=Number(input.shift())
- needMoney -=savedMoney;
- }
- console.log(`Going to ${country}!`);
- country=input.shift();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement