You are given a string s that represents a valid non-negative integer. Your task is to convert the string into its corresponding integer value. You are not allowed to use built-in conversion functions such as stoi(), parseInt(), or similar methods. Return the integer value.
Example 1
Input: s = "1234"
Output: 1234
Explanation: The string is converted to its integer value.
Example 2
Input: s = "0010"
Output: 10
Explanation: Leading zeros are ignored in the integer value.
Example 3
Input: s = "7"
Output: 7
Explanation: A single digit string converts directly to the same integer.
Sign in to write, run, and submit your solution against the full test suite.