I recently started doing these code-chef practice questions and there was this question that particularly got my interest. It’s a simple question. It says for a number(n) entered you have to find it’s factorial(n!). Yeah! Pretty simple isn’t it. All you have to do is a loop from 1 to n multiplying each number to it’s previous one.
Your number can range from 1 <= n <= 100. Bam! C++ is not capable of storing long numbers like that. The long int in C++ can only hold up to 10 digits and in the worst case 100! will have 158 digits. Wow!
Python to the rescue. Python has something called a BigInteger which basically says it has no limit on the number of digits and can be as long as the system memory can support. And boom! storing large numbers isn’t a big deal anymore.
I feel it’s good to have a mix and match of languages while doing competitive programming. Kind of makes you realize why so many languages exists.