码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-12-16 18:55:52      阅读:126      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!