Skip to content

Commit 69434b0

Browse files
committed
fix: invalid c solution for lc problem: No.0709
No.0709.To Lower Case
1 parent 430b827 commit 69434b0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
impl Solution {
2-
pub fn to_lower_case(s: String) -> String {
3-
String::from_utf8(
4-
s.as_bytes()
5-
.iter()
6-
.map(|&c| c + if c >= b'A' && c <= b'Z' { 32 } else { 0 })
7-
.collect(),
8-
)
9-
.unwrap()
1+
char *toLowerCase(char *s) {
2+
int n = strlen(s);
3+
for (int i = 0; i < n; i++) {
4+
if (s[i] >= 'A' && s[i] <= 'Z') {
5+
s[i] |= 32;
6+
}
107
}
8+
return s;
119
}

0 commit comments

Comments
 (0)