Instructions:
An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case.
Example: (Input --> Output)
"Dermatoglyphics" --> true
"aba" --> false
"moOse" --> false (ignore letter case)
Thoughts:
- Converting the string to lowercase to ensure case insensitivity.
- Using nested loops to compare each character with every subsequent character.
- Returning false immediately if a duplicate character is found.
- Returning true if no duplicates exist after checking all characters.
This is a CodeWars Challenge of 7kyu Rank (https://www.codewars.com/kata/54ba84be607a92aa900000f1/solutions/javascript)
Top comments (0)