Created
January 27, 2012 17:59
-
-
Save petejohanson/1690043 to your computer and use it in GitHub Desktop.
Fun Friday Algorithm!
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
new[] { | |
new DateTime (2012, 01, 01, 13, 0, 0), | |
new DateTime (2012, 01, 01, 9, 0, 0), | |
new DateTime (2012, 01, 02, 1, 0, 0), | |
new DateTime (2012, 01, 02, 23, 10, 0), | |
}.GroupBy (dt => dt.Date) | |
.OrderBy (grp => grp.Key) | |
.SelectMany (g => g.OrderByDescending (d => d)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment