Isogram

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:

  • lumberjacks
  • background
  • downstream
  • six-year-old

The word isograms, however, is not an isogram, because the s repeats.

Source

Wikipedia https://en.wikipedia.org/wiki/Isogram

Version compatibility

This exercise has been tested on Julia versions >=1.0.

Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Your solution


In [ ]:
# submit
function isisogram(s::AbstractString)

end

Test suite


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

Prepare submission

To submit your exercise, you need to save your solution in a file called isogram.jl before using the CLI. You can either create it manually or use the following functions, which will automatically write every notebook cell that starts with # submit to the file isogram.jl.


In [ ]:
# using Pkg; Pkg.add("Exercism")
# using Exercism
# Exercism.create_submission("isogram")