Пример #1
0
        public void LongestSequence_OnListWith2Subsequences_IsTheBiggerSubsequence()
        {
            string numbers = "1 2 3 3 4 5 5 5";
            List<int> list = numbers.Split().Select(int.Parse).ToList();

            var sequenceFinder = new Sequence_Finder();

            string result = sequenceFinder.Get_Longest_Sequence(list);

            Assert.AreEqual("5 5 5", result);
        }
Пример #2
0
        public void LongestSequence_OnListWithSomeEqualElements_IsTheRightElements()
        {
            string numbers = "1 2 3 3 4 5 6";
            List<int> list = numbers.Split().Select(int.Parse).ToList();

            var sequenceFinder = new Sequence_Finder();

            string result = sequenceFinder.Get_Longest_Sequence(list);

            Assert.AreEqual("3 3", result);
        }
Пример #3
0
        public void LongestSequence_OnDifferentNumbersList_IsFirstElement()
        {
            string numbers = "1 2 3 4";
            List<int> list = numbers.Split().Select(int.Parse).ToList();

            var sequenceFinder = new Sequence_Finder();

            string result = sequenceFinder.Get_Longest_Sequence(list);

            Assert.AreEqual("1",result);
        }
Пример #4
0
        static void Main(string[] args)
        {
            List<int> list = Console.ReadLine()
                .Split()
                .Select(int.Parse)
                .ToList();

            var sequenceFinder = new Sequence_Finder();

            var result = sequenceFinder.Get_Longest_Sequence(list);
            Console.WriteLine(result);
        }