In this challenge, you have to create a class to deal with Big Integers. It will be used just a single static method called max, used to find the Big Integer with the highest value among the given data.
You'll have to manage also a series of exceptions, establishing if the given input is valid:
MAX_SAFE_INTEGER will be converted into a Big Integer (before calculating the max value).MAX_SAFE_INTEGER will be converted into a Big Integer (before calculating the max value).null.The max method applied to the input has to returns:
null if no input is given."Big Error" if the input contains invalid data.Big.max(1n, 10n, 5n) ➞ 10n
Big.max("10", 5n, 1) ➞ 10n
Big.max() ➞ null
Big.max(2 ** 53 - 1) ➞ 9007199254740991n
Big.max(2 ** 53) ➞ "Big Error"
Big.max("10" / 3) ➞ "Big Error"
Big.max("10" / 2) ➞ 5n
Big.max(10 - 12, 10 - 10, 10 - 11) ➞ 0n
Big.max(0n) ➞ 0n
Big.max("") ➞ "Big Error"