export const isArmstrongNumber = (candidate: bigint | number): boolean => candidate .toString() .split('') .map(BigInt) .reduce((result, value, _index, arr) => result + (value ** BigInt(arr.length)), 0n ) === BigInt(candidate);