S*******C 发帖数: 822 | 1 给我toUpper函数,让实现toLower函数。基本上就是事先通过toupper得到所有小转大
的pair,然后存哈希。 |
S*******C 发帖数: 822 | |
b******n 发帖数: 851 | 3 我估计就是
1) 用toUpper(string s), so that u get a hashMap
whose key is the Uppercase letter, and the value is the lower case letter (
kinda like an inverted index...)
2) and use the hashmap to implement toLower
【在 S*******C 的大作中提到】 : 给我toUpper函数,让实现toLower函数。基本上就是事先通过toupper得到所有小转大 : 的pair,然后存哈希。
|
d******e 发帖数: 2265 | 4 return x - upper a + a
简单数学性质
【在 S*******C 的大作中提到】 : 给我toUpper函数,让实现toLower函数。基本上就是事先通过toupper得到所有小转大 : 的pair,然后存哈希。
|
l*********u 发帖数: 19053 | 5 本懒蛋记ascii table方法 :)
A=65,a=97
so, toLower(x)=toUpper(x)+(97-65) ? :)
【在 S*******C 的大作中提到】 : 给我toUpper函数,让实现toLower函数。基本上就是事先通过toupper得到所有小转大 : 的pair,然后存哈希。
|