Create MaximalSequenceOfEquals

It's a program for finding maximal icreasing sequence of numbers in an array
Example: input: {3, 2, 3, 4, 2, 2, 4} output: {2, 3, 4}