Matsushita's Blog

Determine if a string has all unique characters

Problem

Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures.

How to solve

Character can be transformed into integer. So, by using array its size is 256(ASCII), we can check if a character already appeared or not.

Source Code