Leetcode 742 Solution
This article provides solution to leetcode question 742 (to-lower-case)
Access this page by simply typing in "lcs 742" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/to-lower-case
Solution
class Solution {
public:
string toLowerCase(string str) {
for (int i = 0; i < str.size(); i++)
{
if ('A' <= str[i] && str[i] <= 'Z')
str[i] += 'a' - 'A';
}
return str;
}
};