To Lower Case

Given a string `s`, return the string after replacing every uppercase letter with the same lowercase letter.

30:00

To Lower Case
easy
Free written solution
Topics
Companies

Given a string s, return the string after replacing every uppercase letter with the same lowercase letter.

Example 1:
Input: {"s":"Hello"}
Output: hello
Constraints:
  • 1 <= s.length <= 100

  • s consists of printable ASCII characters.

Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result

Run code to see results.

Input
arr ={"s":"Hello"}

In ASCII, 'A'..'Z' are 65..90 and 'a'..'z' are 97..122: each lowercase letter is its uppercase code plus 32, which is exactly bit 5.

s (top) to out (bottom)

read 0/5 · lowered 0

H

+32

e

=

l

=

l

=

o

=

bits of the current character

128

64

32

16

8

4

2

1

'A' = 0100 0001 and 'a' = 0110 0001 differ only in the 32 bit.

out

_
Variables
VariableValue
out""
DepthFunction Call
Stack empty
0/7