Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
find maximum consecutive repeating character
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string str = "aaaaaabbcbbbbbcbbbb"; string longestRun = new string(str.Select((c, index) => str.Substring(index).TakeWhile(e => e == c)) .OrderByDescending(e => e.Count()) .First().ToArray()); Console.WriteLine(longestRun); } } }
run
|
edit
|
history
|
help
0
Selection sort
test
C# INDEXER and OVERRIDE INDEXER
Create Sealed Class Object
fracOp
Selected Poetry of Rumi doy/poem#
hacker
DateTime
Error
Split IPs to 8 and 16