Created
March 10, 2023 16:59
-
-
Save rabestro/0ebe6167608577c6547336de371d5b78 to your computer and use it in GitHub Desktop.
Determine if a word or phrase is an isogram.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
main () { | |
local -r phrase=${1@L} | |
local symbols=${phrase//[[:space:]-]/} | |
for letter in {a..z} | |
do | |
symbols="${symbols/$letter/}" | |
done | |
[[ -z $symbols ]] && echo 'true' || echo 'false' | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment