Advertisement
Guest User

vtora

a guest
Apr 7th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(t){let o=t.shift();const n=""!==o?o.split(" ").map(t=>+t):[],s=[];let e=0,i=t.shift();for(;"End"!==i;){const o=+i;if(o<0||o>n.length-1||-1===n[o]){i=t.shift();continue}const l=n[o];n[o]=-1,e++,s.push(o);for(let t=0;t<n.length;t++)-1!==n[t]&&(n[t]>l?n[t]-=l:n[t]+=l);i=t.shift()}console.log(`Shot targets: ${e} -> ${n.join(" ")}`)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement