String Construction

  • + 0 comments

    Java

    public static int stringConstruction(String s) {
            Set<Character> uniqueElements = new HashSet<>();
            for (char character : s.toCharArray()) {
                uniqueElements.add(character);
            }
            return uniqueElements.size();
        }