@@ -0,0 +1,948 @@
+package com.matao.ArraysAndStrings;%0A%0A/**%0A * Created by matao on 2018/9/30.%0A * %3Cp%3E%0A * Implement an algorithm to determine if a string has all unique characters.%0A * What if you cannot use additional data structures?%0A */%0Apublic class Q1_UniqueCharacter %7B%0A%0A    public static boolean isUniqueChars(String str) %7B%0A        if (str.length() %3E 128) %7B%0A            return false;%0A        %7D%0A%0A        boolean%5B%5D charSet = new boolean%5B128%5D;%0A        for (int i = 0; i %3C str.length(); i++) %7B%0A            char c = str.charAt(i);%0A            if (charSet%5Bc%5D) %7B%0A                return false;%0A            %7D%0A            charSet%5Bc%5D = true;%0A        %7D%0A        return true;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(isUniqueChars(%22123%22));%0A        System.out.println(isUniqueChars(%22%22));%0A        System.out.println(isUniqueChars(%22 %22));%0A        System.out.println(isUniqueChars(%22a%22));%0A        System.out.println(isUniqueChars(%22aba%22));%0A    %7D%0A%7D%0A

add Q1 UniqueCharacter