Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 436 Bytes

File metadata and controls

36 lines (21 loc) · 436 Bytes

Is Unique

This algorithms checks if a string has all unique characters in O(n) time.

Install

pip install allalgorithms

Usage

from allalgorithms.string import is_unique

str = "abcdefg"

print(is_unique(str)
# -> True

str = "test"

print(is_unique(str)
# -> False

API

is_unique(string)

Return True if string has all unique characters, False otherwise

Params:
  • string: Input String