+ 1
Maybe Sololearn terminal cuts execution over 1ââ, optimise for every user (try my code) .
And permutation needs many time in large size.
So, try such code , you should use other terminal.
https://code.sololearn.com/cK22WODOZIM3/?ref=app
+ 1
Sololearn times out very quickly. I would recommend using a local installation for anything but the most simple programs instead if possible. If that's not an option see if you can find a different online service for ruby that gives you more resources.