Small factorial challenge impossible with JavaScript

While doing the challenge and looking through the tutorial I’ve noticed that this problem is doomed to be insolvable in some (at least one - javascript) coding languages due to the severely narrow time limit of around 0.2 seconds.

I’ve followed the tutorial as well as I could, this is my code together with another approach using BigInt, which also failed, due to it not being defined (maybe there are some dependencies missing)

let reader = new BufferedReader( new InputStreamReader(System['in']) );

let t = parseInt(;

/*for (let i = 0; i<t; i++){
    let v = parseInt(;
    let res = 1;
    let arr = [];
    for (let i = 2; i<=v; i++){
        let temp = 0; 
        let index;
        for (let j = 0; j<arr.length; j++){
            let x = arr[j]*i + temp; //120
            temp = Math.floor(x/10); //12
            arr[j] = x%10;          //0
            arr[index] = temp%10;

for (let i = 0; i<t; i++){
    let v = parseInt(;
    let res = BigInt(1);
    for (let i = 2; i<=v; i++){
      res*= BigInt(i);

Interestingly, I’m not the only JS coder here that has run into this problem - when looking at the JS submissions for this challenge - there hasn’t been a single person yet to have passed this challenge with JS.

Therefore, dear problem hoster, if you happen to read this, please edit the time limit to at least 0.5 seconds, as this lacks fairness to some degree. Or take JavaScript out of the list of supported languages for this challenge, that would be okay as well, but I personally find it disappointing to sit hours in front of a challenge like this, trying everything and not succeeding because it’s not possible.

I used BigInteger instead of Bigint which is not available in rhino. Precompute the factorials and just query it.

Okay, seems like I’m wrong then, thank you for your reply! learned something new