Example #1
0
        public void absolutePermutationTestCase1Step3()
        {
            int n = 3;
            int k = 2;

            int[] result = AbsolutePermutation.absolutePermutation(n, k);

            Assert.AreEqual(-1, result[0]);
        }
Example #2
0
        public void absolutePermutationTestCase1Step1()
        {
            int n = 2;
            int k = 1;

            int[] result = AbsolutePermutation.absolutePermutation(n, k);

            Assert.AreEqual(2, result[0]);
            Assert.AreEqual(1, result[1]);
        }
Example #3
0
        public void MainFlow(string inputString, string expectedString)
        {
            var input    = new StringReader(inputString);
            var expected = new StringReader(expectedString);

            int t = Convert.ToInt32(input.ReadLine());

            for (int tItr = 0; tItr < t; tItr++)
            {
                string[] nk = input.ReadLine().Split(' ');

                int n = Convert.ToInt32(nk[0]);

                int k = Convert.ToInt32(nk[1]);

                int[] result = AbsolutePermutation.absolutePermutation(n, k);

                var finalResult = string.Join(" ", result);
                var fExpected   = expected.ReadLine();
                Assert.AreEqual(fExpected, finalResult);
            }
        }