Пример #1
0
        public void Test()
        {
            var values = new[] { 1, 11, 5, 5 };
            Assert.IsTrue(Partition.CanItBePartitioned(values));

            values = new[] { 1, 7, 2, 3, 4, 5 };
            Assert.IsTrue(Partition.CanItBePartitioned(values));

            values = new[] { 1, 7, 2, 3, 6, 5 };
            Assert.IsTrue(Partition.CanItBePartitioned(values));

            values = new[] { 7, 2, 6, 9 };
            Assert.IsFalse(Partition.CanItBePartitioned(values));
        }
 public void Test()
 {
     var values = new[] { 1, 12, 3, 2, 3, 1, 1, 12, 3, 12 };
     Assert.AreEqual(FindUniqueAmongTriplets.Find(values), 2);
 }