I'm currently practicing on a website where they have time constraints for each challenge. Having fixed everything I could and still failing the time constraint of 0.5 seconds, I believe the high calculation time has something to do with my usual code of assigning a numbers string (e.g. "1 2 3" from system.in) to a variable by converting it into an array. My question would be if that one liner can be improved or if there is some better version of the java scanner (java scanner is very time inefficient) or bufferedreader that can be used in javascript so that not every spaced numbers string has to be converted into an array and then mapped to ints. here is my code so far:
importPackage(java.io);
importPackage(java.lang);
let reader = new BufferedReader( new InputStreamReader(System['in']) );
let t = parseInt(reader.readLine());
for (let i = 0; i<t; i++){
let v = reader.readLine().split(" ").map(function(i){return parseInt(i)}); //this here
print(v[0] + v[2] === 180 ? "yes" : "no")
}