Inspired by this. There is a number, given as either integer, string or array of digits (your choice). Find the base in which the representation of the number will have most "4"s and return that base.
Number Result 624 5 444 10 68 16
restrictions:
- The base returned should not be greater than the input.
- Numbers less than or equal to 4 should not be considered valid input, so undefined returns are acceptable
[1,15,3,64,43]for some number in base80. You're only outputting the base number, so you could technically test every base from2ton. \$\endgroup\$1,2, and3, which have the same number of "4"s (0) in every base? Also, many numbers have the same number of "4"s in many bases (e.g.,4in any base > 5,44in any base > 45,14in base 9, or any base > 15, etc). Should the correct answer be the smallest base with the largest number of "4"s? \$\endgroup\$