Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 421 Bytes

File metadata and controls

26 lines (21 loc) · 421 Bytes

Any Base To Decimal

Easy


  1. You are given a number n.
  2. You are given a base b. n is a number on base b.
  3. You are required to convert the number n into its corresponding value in decimal number system.

Example 1:

Input:  111001 2
Output:  57

Example 2:

Input:  1266 8
Output:  694

Constraints:

0 <= d <= 1000000000
2 <= b <= 10