class Solution { //双指针暴力解法
public boolean isUnique(String astr) {
boolean isSame = true;
for(int i = 0; i < astr.length() - 1; i++)
{
for(int j = i + 1; j < astr.length(); j++)
{
if(astr.charAt(i) == astr.charAt(j))
{
return false;
}
}
}
return isSame;
}
}
LeetCode.面试题01.01.判断字符是否唯一(Java实现)
猜你喜欢
转载自blog.csdn.net/qq_45824565/article/details/104457067
今日推荐
周排行