728x90 String to Integer (atoi)1 [LeetCode] 8. String to Integer (atoi) Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: 1. Read in and ignore any leading whitespace. 2. Check if the next character (if not already at the end of the string) is ' - ' or ' + '. Read this character in if it is either. This determines if the final result is neg.. 2023. 10. 16. 이전 1 다음 728x90