Skip to content

Instantly share code, notes, and snippets.

@lordvidex
Last active March 28, 2020 10:12
Show Gist options
  • Save lordvidex/a8331bce216cab4939d0489bb415c1f1 to your computer and use it in GitHub Desktop.
Save lordvidex/a8331bce216cab4939d0489bb415c1f1 to your computer and use it in GitHub Desktop.
Evans Owamoyo:: Day 3 Track 1
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');
}
@lordvidex
Copy link
Author

Little etchcase fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment