implement myatoistring s function convert string 32bit sign integer similar ccs atoi functionThe algorithm myatoistre s followsread ignore lead whitespacecheck character end string read character this determine final result negative positive respectively Assume result positive presentread character nondigit character end input reach the rest string ignoredConvert digit integer ie 123 123 0032 32 if digit read integer 0 change sign necessary step 2If integer 32bit sign integer range 231 231 1 clamp integer remain range specifically integer 231 clamp 231 integer great 231 1 clamp 231 1return integer final resultnoteonly space character consider whitespace characterDo ignore character lead whitespace rest string digit Example 1input s 42output 42explanation the underlined character read caret current reader positionstep 1 42 character read lead whitespace step 2 42 character read step 3 42 42 read the parse integer 42since 42 range 231 231 1 final result 42example 2input s 42output 42explanationstep 1 42 lead whitespace read ignore step 2 42 read result negative step 3 42 42 read the parse integer 42since 42 range 231 231 1 final result 42example 3input s 4193 wordsoutput 4193explanationstep 1 4193 word character read lead whitespace Step 2 4193 word character read step 3 4193 word 4193 read read stop character nondigit the parsed integer 4193since 4193 range 231 231 1 final result 4193 constraints0 slength 200s consist english letter lowercase uppercase digit 09