int [ ] array = { 10 , 2 , 9 , 3 , 5 , 4 , 6 , 8 } ; int [ ] array = { 10 , 9 , 8 , 6 , 5 , 4 } ;
List < int > list = new List < int > ( ) ; List < int > longestList = new List < int > ( ) ; int currentMax ; int highestCount = 0 ; for ( int i = 0 ; i < array . Length ; i ++ ) { currentMax = int . MinValue ; for ( int j = i ; j < array . Length ; j ++ ) { if ( array [ j ] > currentMax ) { list . Add ( array [ j ] ) ; currentMax = array [ j ] ; } }