Last active
March 28, 2020 10:12
-
-
Save lordvidex/a8331bce216cab4939d0489bb415c1f1 to your computer and use it in GitHub Desktop.
Evans Owamoyo:: Day 3 Track 1
This file contains 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
Map<String,bool> count = {}; | |
bool isIsogram(String s) { | |
var answer = true; | |
s = s.replaceAll(new RegExp(r'\s|-'), '').toLowerCase(); | |
s.split('').forEach((sd){ | |
if(count[sd]==null)count[sd]= true; | |
else answer = false; | |
}); | |
return answer; | |
} | |
void main() { | |
print(isIsogram('downstream')?'String is an Isogram':'String is NOT an Isogram'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Little etchcase fixed