예제 #1
0
    static void Main(string[] args)
    {
        testSubTrees();
        // Call numberOfWays() with test cases here
        string S = "facebook";

        Console.WriteLine(EncryptedWords.findEncryptedWord(S));
        int[] arr = { 5, 5, 6, 2, 1, 7, 8, 3 };//2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
        int   k   = 4;

        Console.WriteLine(String.Format("{0} n of ways", PairSums.numberOfWays(arr, k)));
        string toCipher = "<yzf-k_x+!a";

        // Console.WriteLine(RotationalCipher.rotationalCipher(toCipher, 3));
        int[] restuls = LargestTripleProducts.findMaxProduct(arr);
        Array.ForEach(restuls, Console.WriteLine);
    }
 public void FindMaxProduct_Empty_Empty()
 {
     LargestTripleProducts.FindMaxProduct(Array.Empty <int>()).Should().BeEmpty();
 }
 public void FindMaxProduct_Sample1_Expected()
 {
     LargestTripleProducts.FindMaxProduct(new[] { 1, 2, 3, 4, 5 })
     .Should().Equal(new[] { -1, -1, 6, 24, 60 });
 }