Parse an Integer in Any Base
Asked at Microsoft· Onsite
Reported by the problem's creator, not verified
You implement one function, parse_base_integer(text, base). Each test is a single call. It returns the decimal value of text read in base as a string, or the word INVALID or OVERFLOW when the text or the value is not acceptable.
Examples
Example 1
Input: text =
ff, base =16Output:
255Explanation:
fis 15, soffis 15 * 16 + 15 = 255.
Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.