Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Once solved, you can check out the author's (@myjinxin2015) solution to see how they did it without the need for BigInt or imported modules.
There are libraries which help with that (
bignumber.js
or native support for big numbers available since Node 10) but if you are going to calculaten^n
, it won't really help you. The number will get so big, you will run out of memory.Additionally, if you structure your solution correctly, you will not even need big numbers. This problem can be solved in domain well below
Number.MAX_SAFE_INTEGER
.