Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.
Example 1:
Input: "Hello"
Output: "hello"
Solution:
Idea:
The ASCII code for lowercase and uppercase is different by 32.
Time Complexity: O(n)
Space Complexity: O(n)
deftoLowerCase(str):""" :type str: str :rtype: str """# use build-in function in python# return str.lower()# use ASCII code out =''for c instr:iford(c)<=90andord(c)>=65: c =chr(ord(c) +32) out += creturn out