TheRealSamuel/LeetCodeProblem
0564
1 2module Main where3import Test.HUnit4 5--Program start6isPossibleToSplit :: [Int] -> Bool7isPossibleToSplit nums = undefined8 9--Program end10 11-- Test cases12 13test1 :: Test14test1 = TestCase (assertEqual "for (isPossibleToSplit [1,1,2,2,3,4])," True (isPossibleToSplit [1,1,2,2,3,4]))15 16test2 :: Test17test2 = TestCase (assertEqual "for (isPossibleToSplit [1,1,1,1])," False (isPossibleToSplit [1,1,1,1]))18 19test3 :: Test20test3 = TestCase (assertEqual "for (isPossibleToSplit [79, 98, 70, 52, 79, 93, 39, 1, 73, 8, 33, 89, 99, 78, 78, 42])," True (isPossibleToSplit [79, 98, 70, 52, 79, 93, 39, 1, 73, 8, 33, 89, 99, 78, 78, 42]))21 22test4 :: Test23test4 = TestCase (assertEqual "for (isPossibleToSplit [28, 33, 20, 86, 85, 55, 87, 90, 18, 57, 11, 11, 87, 62, 23, 74, 67, 22, 81, 31, 1, 68, 87, 26, 12, 78, 66, 88, 26, 3, 58, 99, 14, 78, 72, 6, 64, 98])," False (isPossibleToSplit [28, 33, 20, 86, 85, 55, 87, 90, 18, 57, 11, 11, 87, 62, 23, 74, 67, 22, 81, 31, 1, 68, 87, 26, 12, 78, 66, 88, 26, 3, 58, 99, 14, 78, 72, 6, 64, 98]))24 25test5 :: Test26test5 = TestCase (assertEqual "for (isPossibleToSplit [100, 87, 98, 2, 31, 68, 54, 5, 71, 39, 95, 53, 90, 26, 77, 13, 73, 6, 89, 55, 14, 18, 46, 9, 66, 17, 69, 89, 76, 64, 49, 90, 97, 58, 5, 5, 9, 1, 35, 76, 77, 82, 49, 8])," False (isPossibleToSplit [100, 87, 98, 2, 31, 68, 54, 5, 71, 39, 95, 53, 90, 26, 77, 13, 73, 6, 89, 55, 14, 18, 46, 9, 66, 17, 69, 89, 76, 64, 49, 90, 97, 58, 5, 5, 9, 1, 35, 76, 77, 82, 49, 8]))27 28test6 :: Test29test6 = TestCase (assertEqual "for (isPossibleToSplit [71, 63, 77, 63, 91, 18, 89, 39, 41, 49, 64, 58, 26, 99, 14, 40, 69, 44, 85, 58, 26, 48, 92, 45, 48, 77, 46, 27, 21, 25, 17, 10, 4, 72, 43, 43, 7, 48, 6, 79, 34, 56, 21, 1, 57, 89, 78, 48, 93, 49, 88, 65, 12, 74, 33, 9, 18, 73, 53, 43, 29, 3, 22, 58, 25, 46, 72, 86, 76, 5, 85, 11, 14, 14, 41, 97, 9, 54, 41, 53, 57, 33, 43, 44])," False (isPossibleToSplit [71, 63, 77, 63, 91, 18, 89, 39, 41, 49, 64, 58, 26, 99, 14, 40, 69, 44, 85, 58, 26, 48, 92, 45, 48, 77, 46, 27, 21, 25, 17, 10, 4, 72, 43, 43, 7, 48, 6, 79, 34, 56, 21, 1, 57, 89, 78, 48, 93, 49, 88, 65, 12, 74, 33, 9, 18, 73, 53, 43, 29, 3, 22, 58, 25, 46, 72, 86, 76, 5, 85, 11, 14, 14, 41, 97, 9, 54, 41, 53, 57, 33, 43, 44]))30 31test7 :: Test32test7 = TestCase (assertEqual "for (isPossibleToSplit [64, 53, 60, 80, 73, 94, 64, 27, 85, 2, 67, 46, 39, 55, 11, 75, 96, 19, 98, 40, 87, 33, 51, 66, 7, 72, 25, 13, 89, 3, 99, 15, 39, 55, 38, 96, 23, 83, 22, 22, 48, 26, 19, 33, 76, 86, 56, 32, 96, 23, 15, 100, 49, 43, 81, 38, 80, 25, 43, 39, 51, 43, 78, 45, 54, 77, 66, 75, 71, 5, 47, 18, 28, 86, 68, 78, 71, 70, 46, 12, 27, 36, 23, 76, 37, 77, 69, 56, 3, 35, 80, 40, 56, 62, 51, 44])," False (isPossibleToSplit [64, 53, 60, 80, 73, 94, 64, 27, 85, 2, 67, 46, 39, 55, 11, 75, 96, 19, 98, 40, 87, 33, 51, 66, 7, 72, 25, 13, 89, 3, 99, 15, 39, 55, 38, 96, 23, 83, 22, 22, 48, 26, 19, 33, 76, 86, 56, 32, 96, 23, 15, 100, 49, 43, 81, 38, 80, 25, 43, 39, 51, 43, 78, 45, 54, 77, 66, 75, 71, 5, 47, 18, 28, 86, 68, 78, 71, 70, 46, 12, 27, 36, 23, 76, 37, 77, 69, 56, 3, 35, 80, 40, 56, 62, 51, 44]))33 34 35-- Grouping test cases36tests :: Test37tests = TestList [TestLabel "Test1" test1, TestLabel "Test2" test2, TestLabel "Test3" test3, TestLabel "Test4" test4, TestLabel "Test5" test5, TestLabel "Test6" test6]38 39-- Running the tests40main :: IO Counts41main = runTestTT tests42 