Isograms
Madalina Pastiu

Madalina Pastiu @maddiepst

Joined:
Mar 3, 2025

Isograms

Publish Date: Mar 20
0 0

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:

  1. Converting the string to lowercase to ensure case insensitivity.
  2. Using nested loops to compare each character with every subsequent character.
  3. Returning false immediately if a duplicate character is found.
  4. Returning true if no duplicates exist after checking all characters. Solution

Test
This is a CodeWars Challenge of 7kyu Rank (https://www.codewars.com/kata/54ba84be607a92aa900000f1/solutions/javascript)

Comments 0 total

    Add comment