Definition:
Write a generic function that return the longest consecutive sequence contained within a source sequence.
Examples
{ 1, 2, 3, 0, 1 } => { 1, 2, 3 }
ABABCERSTU => RSTU
00001 => 0
To ensure compatibility and consistency between different entries, all entries must implement the following interface.
This is available via NuGet: DIC Challenge Longest Consecutive Sequence
Minimum .Net Framework:= .net 3.5 (Client Profile)
Interface
''' <summary> ''' the Interface required for the Challege: Longest Consecutive Sequence. ''' </summary> ''' <typeparam name="T">The Generic Type Parameter</typeparam> ''' <param name="Source">The Source IEnumerable</param> ''' <param name="SeqPred">Used to determing the consectiviness of the sequence.</param> ''' <returns>An IEnumerable containing the longest consecutive sequence contained in the source.</returns> ''' <remarks></remarks> Function LCSeq(Of T)(Source As IEnumerable(Of T), SeqPred As Func(Of T, T, Boolean)) As IEnumerable(Of T)
This post has been edited by AdamSpeight2008: 10 December 2011 - 10:25 AM

New Topic/Question
Reply



MultiQuote








|