首页 > 其他 > 详细

1.1---判断字符串是否所有字符都不相同(CC150)

时间:2015-12-16 18:54:10      阅读:153      评论:0      收藏:0      [点我收藏+]
import java.util.*;
 
public class Different {
    public boolean checkDifferent(String str) {
        // write code here
        for(int i = 0; i < str.length(); i++){
            for(int j = i + 1; j < str.length(); j++){
                if(str.charAt(i) == str.charAt(j)) return false;
            }
        }
        return true;
    }
}

 

1.1---判断字符串是否所有字符都不相同(CC150)

原文:http://www.cnblogs.com/yueyebigdata/p/5051782.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!