Your question is String Unique Characters. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
J.B. Hunt 360 may receive shipment reference strings from multiple operational workflows. Implement a function that determines whether a string contains only unique characters.
Treat characters as distinct based on their exact values. The comparison is case-sensitive, so A and a are different characters. Spaces, punctuation, digits, and other characters must also be checked. Return True when no character appears more than once, and return False as soon as a duplicate is found.
Given one string s, return a boolean:
True if every character in s occurs exactly once or the string is empty.False if any character occurs more than once.Do not modify the input string.
def has_unique_characters(s):