String to Integer (atoi)MediumAcceptance Rate 16.8%Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer.ExamplesExample 1Inputs = "42"Output42Constraints0 <= s.length <= 200s consists of English letters, digits, " ", "+", "-", and ".".