Forgone Solution

For everyone attempting this solution, discuss here.

3 Likes

What is better, take N as a integer variable or as an array??

2 Likes

I took it as a variable because Google expects the output as soon as they give the input to your program, as you can see in the given sample test case scenario. So, taking all inputs at once into an array and then outputting them later might not work.

2 Likes

how to correct the run time error

1 Like
how to correct the RE
1 Like

i tried 2 approaches (both Array and Variable) . both times i get a Run-time Error in submission. but when i intentionally output incorrect answers it just says its incorrect. any solution?

did you test it on local so that there are no errors in your code?

1 Like

i did. it worked flawlessly on local.
just now tried a third method and passed. :smiley::smiley::smiley::smiley:

1 Like

plz give me an example for google codejam javascript(nodejs) stdin and stdout

Congratulations !!! :smile::relaxed:

1 Like