Skip to content
the poor coder

Leetcode - To Lower Case Solution

Poor Man
Published
Updated
Reading time
1 min read

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.

Example 1:

Text
Input: "Hello"
Output: "hello"

Example 2:

Text
Input: "here"
Output: "here"

Example 3:

Text
Input: "LOVELY"
Output: "lovely"

Solution in Python#

Python
class Solution:
    def toLowerCase(self, str: str) -> str:
        return str.lower()

Keep going

2021

Leetcode - Camelcase Matching Solution

A query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.) Given a list of…

ESC