Changing "int" to "Integer" gives significant performance improvement!

Revision en2, by vivekiitian, 2019-06-05 22:02:10

I tried to solve this problem. Refer to my solution 1 and 2. The only difference between those solutions is datatype int is replaced by Integer and solution got accepted (runtime got reduced from more than 1s to 140 ms). Any idea why is it happening?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vivekiitian 2019-06-05 22:02:10 2
en1 English vivekiitian 2019-06-05 22:01:01 490 Initial revision (published)