Skip to content

Instantly share code, notes, and snippets.

@buvinghausen
Last active May 25, 2021 16:49
Show Gist options
  • Save buvinghausen/96b6d679e61339207203db2ae588a8b0 to your computer and use it in GitHub Desktop.
Save buvinghausen/96b6d679e61339207203db2ae588a8b0 to your computer and use it in GitHub Desktop.
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