Map each character through its lowercase representation while leaving non-uppercase characters unchanged.
Complexity
O(n) time and O(n) output space.
Convert every uppercase English letter in a string to lowercase.
Map each character through its lowercase representation while leaving non-uppercase characters unchanged.
O(n) time and O(n) output space.
package main
import "strings"
func toLowerCase(s string) string {
return strings.ToLower(s)
}
class Solution:
def toLowerCase(self, s: str) -> str:
return s.lower()
function toLowerCase(s: string): string {
return s.toLowerCase();
}