Esempio n. 1
0
        public void TestWordSearch2()
        {
            var chars = new char[, ]
            {
                { 'o', 'a', 'a', 'n', 'x' },
                { 'e', 't', 'a', 'e', 'e' },
                { 'i', 'h', 'k', 'r', 'e' },
                { 'i', 'f', 'l', 'v', 'o' }
            };
            var wordSearch2 = new WordSearch2();
            var r           = wordSearch2.FindWords(chars, new[] { "aa", "oa", "oaa", "oaa", "xeee", "xee", "ihkaanxeeo" });

            Assert.AreEqual(r.Count, 5);
        }
Esempio n. 2
0
        public static void DoMicrosoftProblems()
        {
            //Add2NumberLinkedList solution = new Add2NumberLinkedList();
            //Merge2SortedLists solution = new Merge2SortedLists();
            //SpiralMatrix solution = new SpiralMatrix();
            //MinRotatedSortedArray solution = new MinRotatedSortedArray();
            //BinaryTreeInOrderTraversal solution = new BinaryTreeInOrderTraversal();
            //BinaryTreeLevelOrderTraversal solution = new BinaryTreeLevelOrderTraversal();
            //SetMatrixZero solution = new SetMatrixZero();
            //AddTwoNumbers2 solution = new AddTwoNumbers2();
            //ValidBST solution = new ValidBST();
            //MaxLengthOfNonRCChar solution = new MaxLengthOfNonRCChar();
            //CircularArrayPrint solution = new CircularArrayPrint();
            //MaxSubArrayProb solution = new MaxSubArrayProb();
            //RemoveDuplicateSortedArray solution = new RemoveDuplicateSortedArray();
            //MergeKSortedListLL solution = new MergeKSortedListLL();
            //ReverseInteger solution = new ReverseInteger();
            //KthSmallestBST solution = new KthSmallestBST();
            //PeakElement solution = new PeakElement();
            //Fibonacci solution = new Fibonacci();
            //ArrayProductExceptSelf solution = new ArrayProductExceptSelf();
            //MinHeapTest solution = new MinHeapTest();
            //ZigZag solution = new ZigZag();
            //RepeatedSubString solution = new RepeatedSubString();
            //MaxSubArrayProb solution = new MaxSubArrayProb();
            //MergeIntervals solution = new MergeIntervals();
            //UGraphTest solution = new UGraphTest();
            //TrieCheck solution = new TrieCheck();
            //LongestWordInDictionary solution = new LongestWordInDictionary();
            //LongestCommonPrefixSoln solution = new LongestCommonPrefixSoln();
            //LongestValidParan solution = new LongestValidParan();
            //CentsToChange solution = new CentsToChange();
            //SearchInsertPosition solution = new SearchInsertPosition();
            //WordSearch solution = new WordSearch();
            WordSearch2 solution = new WordSearch2();

            solution.Run();
        }