Easiest way of checking if a string consists of unique characters?

前端 未结 12 1857
慢半拍i
慢半拍i 2021-01-04 23:34

I need to check in Java if a word consists of unique letters (case insensitive). As straight solution is boring, I came up with:

  1. For every char in a string che
12条回答
  •  醉话见心
    2021-01-05 00:30

               import java.io.*;
    
                       class unique
                      {
                               public static int[] ascii(String s)
                               {
                                        int length=s.length();
                                        int asci[] = new int[length];
                                        for(int i=0;i=0 && temp

    }

提交回复
热议问题