Happy Monday!
Let's start the week off right. Today's problem is to create a function that returns if a string contains all unique characters or not. For bonus points make the function case insensitive.
Happy Monday!
Let's start the week off right. Today's problem is to create a function that returns if a string contains all unique characters or not. For bonus points make the function case insensitive.
Permalink: http://problemotd.com/problem/unique-string/
Content curated by @MaxBurstein
Comments:
Anonymous - 10 years ago
C#
reply permalink
Erik - 10 years ago
Using Rust 0.13:
reply permalink
Max Burstein - 10 years ago
Been meaning to play around with Rust. Looks cool
reply permalink
Anonymous - 10 years ago
Python ``` a = raw_input("Enter a string> ")
a = a.lower()
for character in a: if a.count(character) != 1: c = "Not unique" break c = "Unique"
print c ```
reply permalink
David - 9 years ago
Using count() is probably more elegant:
reply permalink