about | help | code help+videos | done | prefs |
Write a method that accepts a 'base' indicating what base 'digits' are in. The array 'digits' contains the digits of a number in 'base'. Convert that number to decimal and return it. Preconditions: 2<=base<=10, 0<=digits[n]<base for each element in digits. Note: The resulting value in base 10 will be less than MAXINT. test2023_01_19_HL_baseToDecimal(9, [2, 6, 1, 0, 4]) → 17581 test2023_01_19_HL_baseToDecimal(4, [3, 0, 0, 2, 0, 1]) → 3105 test2023_01_19_HL_baseToDecimal(8, [5]) → 5 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy