Great Post! Thanks!
My C# approach would be something like this:
static void Main(string[] args) { var sortedString = longString .OrderBy(x => x.Equals('_') ? 2 : 1 ) .ThenBy(x => x) .ToArray(); Console.WriteLine(sortedString); }
The problem with fast shooting, is always the same, mistakes! :/
static void Main(string[] args) { var keyString = new string(longString .OrderByDescending(x => longString.Count(c => c.Equals(x))) .Distinct() .ToArray()); Console.WriteLine(keyString.Split('_')[0]); }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great Post! Thanks!
My C# approach would be something like this:
The problem with fast shooting, is always the same, mistakes! :/