Skip to content

Instantly share code, notes, and snippets.

@internetova
Created November 18, 2020 17:09
Show Gist options
  • Save internetova/99ee222ded150640ddd3cb5d576cfbb4 to your computer and use it in GitHub Desktop.
Save internetova/99ee222ded150640ddd3cb5d576cfbb4 to your computer and use it in GitHub Desktop.
void main() {
// Вывести на экран количество уникальных слов в тексте.
const text = '''
She sells sea shells on the sea shore
The shells that she sells are sea shells I'm sure
So if she sells sea shells on the sea shore
I'm sure that the shells are sea shore shells
''';
final textSet = text.split(' ').toSet();
print('Число уникальных слов ${textSet.length}');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment