Convert a character to lowercase04.01
Lowercasing an uppercase letter adds 32 to its code: 'A' (65) + 32 = 'a' (97). Letters already lower, digits, and marks stay the same.
Only rewrite when ch is in A through Z. Do not add 32 to 'a' or to '0'.
Same skill, three traces. Read all three before you try it.
01upper to lower - given
ch = 'A'- walk
'A'is6565+32=9797is'a'- result
'a'
02already lower - given
ch = 'a'- walk
'a'is already in a throughzleave it
- result
'a'
03non-letter - given
ch = '1'- walk
'1'has no caseadding
32would invent a wrong character- result
'1'
lower(ch).ch is a single ASCII character.
If ch is uppercase, return the lowercase letter. Otherwise return ch unchanged.
On
'A' return 'a'. On 'a' return 'a'. On '1' return '1'.constraintsch is a single ASCII character.
- Valid Palindrome0/3 skills ready · two pointers · easyopen
- Valid Palindrome0/3 skills ready · two pointers · easyopen
Every Check with Awel is frozen here. Open one to read the code or load it back into the editor.