Production-Ready atoi for an Arbitrary Base

Implement a production-ready string-to-integer parser for an arbitrary base, returning a 32-bit signed integer.

Function: parseInt(s, base)

Requirements:

  • base is in the range 2 to 36.
  • I...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: