less than 1 minute read

Given a lowercase alphabet string s, determine whether it has all unique characters.

Constraints

  • 0 ≤ n ≤ 100,000 where n is the length of s

https://binarysearch.com/problems/A-Unique-String

Examples

Example 1

Input

  • s = "abcde"

Output

  • answer = True

Explanation

All characters only occur once

Example 2

Input

  • s = ""

Output

  • answer = True

Explanation

All characters occur once (of which there are none)

Example 3

Input

  • s = "aab"

Output

  • answer = False

Explanation

There’s two as

Solution

Leave a comment