Determine if a word or phrase is an isogram.
An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
Examples of isograms:
The word isograms, however, is not an isogram, because the s repeats.
Wikipedia https://en.wikipedia.org/wiki/Isogram
This exercise has been tested on Julia versions >=1.0.
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
In [ ]:
# submit
function isisogram(s::AbstractString)
end
In [ ]:
using Test
# include("isogram.jl")
@testset "empty string" begin
@test isisogram("")
end
@testset "isogram with only lower case characters" begin
@test isisogram("isogram")
end
@testset "word with one duplicated character" begin
@test !isisogram("eleven")
end
@testset "longest reported english isogram" begin
@test isisogram("subdermatoglyphic")
end
@testset "word with duplicated character in mixed case" begin
@test !isisogram("Alphabet")
end
@testset "hypothetical isogrammic word with hyphen" begin
@test isisogram("thumbscrew-japingly")
end
@testset "isogram with duplicated non letter character" begin
@test isisogram("Hjelmqvist-Gryb-Zock-Pfund-Wax")
end
@testset "made-up name that is an isogram" begin
@test isisogram("Emily Jung Schwartzkopf")
end
In [ ]:
# using Pkg; Pkg.add("Exercism")
# using Exercism
# Exercism.create_submission("isogram")