String to Integer (atoi)

Medium

📝 Description

Implement the atoi function to convert string to integer

Input Format

A string

Output Format

Converted integer

Constraints

0 ≤ s.length ≤ 200

🔍 Sample Input

"   -42"
            

✅ Sample Output

-42
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run