Last active
May 25, 2021 16:49
-
-
Save buvinghausen/96b6d679e61339207203db2ae588a8b0 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Linq; | |
bool isBeautifulString(string inputString) | |
{ | |
var list = Enumerable.Range(Convert.ToInt32('a'), 26).Select(i => inputString.Count(c => c == i)).ToList(); | |
return list.SequenceEqual(list.OrderByDescending(i => i)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment