c*w
2 楼
请问一道题,我的程序就是不能全过large test case。
代码如下:
public class Solution {
public boolean isPalindrome(String s) {
// Start typing your Java solution below
// DO NOT write main() function
if (s == null) {
return false;
}
if (s.length() == 0) {
return true;
}
s = s.toLowerCase();
int start = 0;
int end = s.length() - 1;
while (start <= end) {
char first = s.charAt(start);
char second = s.charAt(end);
if (!isValid(first)) {
start ++;
} else if (!isValid(second)) {
end --;
} else {
if (first != second) {
return false;
}
start ++;
end --;
}
}
return true;
}
public boolean isValid(char ch) {
return ((ch <= 'z' && ch >= 'a') || (ch > '1' && ch < '9'));
}
}
代码如下:
public class Solution {
public boolean isPalindrome(String s) {
// Start typing your Java solution below
// DO NOT write main() function
if (s == null) {
return false;
}
if (s.length() == 0) {
return true;
}
s = s.toLowerCase();
int start = 0;
int end = s.length() - 1;
while (start <= end) {
char first = s.charAt(start);
char second = s.charAt(end);
if (!isValid(first)) {
start ++;
} else if (!isValid(second)) {
end --;
} else {
if (first != second) {
return false;
}
start ++;
end --;
}
}
return true;
}
public boolean isValid(char ch) {
return ((ch <= 'z' && ch >= 'a') || (ch > '1' && ch < '9'));
}
}
p*e
3 楼
1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
$200
2. Voigtlander 20mm SL-II for Nikon with box.
$400
SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
$650
SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
$1600
5. Zeiss ZF 100mm f/2 for Nikon with box and everything
$1150
价格一律不包含运费
我在NYC
谢谢
$200
2. Voigtlander 20mm SL-II for Nikon with box.
$400
SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
$650
SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
$1600
5. Zeiss ZF 100mm f/2 for Nikon with box and everything
$1150
价格一律不包含运费
我在NYC
谢谢
c*w
5 楼
471/475
有四个没过,但是看不到具体的cases。
大牛帮我看一眼,程序哪里有问题?
谢谢
有四个没过,但是看不到具体的cases。
大牛帮我看一眼,程序哪里有问题?
谢谢
f*y
6 楼
文少发飙了?
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
h*s
9 楼
code呐?
c*w
10 楼
(ch >= '1' && ch <= '9')
1到9之间,改过了,变成473/475
1到9之间,改过了,变成473/475
s*s
12 楼
isvalid 里面 A-Z也应该是valid的吧
c*d
13 楼
你买百微纯粹为了resale啊js
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
c*w
20 楼
Thanks. :D
n*e
22 楼
财主。
s*g
29 楼
85L 蛮公道的, if brand new, heart beating
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
S*M
31 楼
何必呢
整天折腾来折腾去,都是给ebay和邮局打工
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
整天折腾来折腾去,都是给ebay和邮局打工
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
G*o
33 楼
85L 1500,出吗?
p*e
38 楼
4 is sold
1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
$200
2. Voigtlander 20mm SL-II for Nikon with box.
$400
3. Zeiss ZF 35mm f/2 for Nikon with box and everything
$650
4. Canon 85mm II f/1.2 L with box hood pouch and everything
$1600
5. Zeiss ZF 100mm f/2 for Nikon with box and everything
$1150
价格一律不包含运费
我在NYC
谢谢
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
$200
2. Voigtlander 20mm SL-II for Nikon with box.
$400
3. Zeiss ZF 35mm f/2 for Nikon with box and everything
$650
4. Canon 85mm II f/1.2 L with box hood pouch and everything
$1600
5. Zeiss ZF 100mm f/2 for Nikon with box and everything
$1150
价格一律不包含运费
我在NYC
谢谢
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
p*e
39 楼
3 IS ALSO SOLD.
【在 p********e 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
【在 p********e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 1. Nikkor 35mm AF-D Lens with metal hood. metal hood上有一个小坑。
: $200
: 2. Voigtlander 20mm SL-II for Nikon with box.
: $400
: SOLD. Zeiss ZF 35mm f/2 for Nikon with box and everything
: $650
: SOLD. Canon 85mm II f/1.2 L with box hood pouch and everything
: $1600
: 5. Zeiss ZF 100mm f/2 for Nikon with box and everything
: $1150
相关阅读
Cool way to take a portrait唉,周一就这么忙。。。收paypal gift有没有什么风险?We are greened! (转载) 包子贴 160个 移步EB23版吃包子Re: 清华儿赴美安家30年只归一次 八旬老妈通道卖菜(z) (转载)best buy有啥gift card可以搞?delaware的筒子买车不用购置税???AAPL新高这会儿就买d700还是在等几个月?伪币的通胀率是多少?Sam Yang的那个35 1.4有人用过吗今天日本真是命硬求求教Don't cry for me, USA10 baozi tonight小白兔里面进了硕大一颗灰点球被扑万佛,D700配什么广角?楼下停着