TheRealSamuel/LeetCodeProblem
0572
1 2module Main = struct3 open OUnit24 5 (* Program start *)6 let minMaxGame (nums: int list) : int = failwith "Not implemented"7 8 (* Program end *)9 10 (* Test cases *)11 12let test1 _ = assert_equal 1 (minMaxGame [1;3;5;2;4;8;2;2])13 14let test2 _ = assert_equal 3 (minMaxGame [3])15 16let test3 _ = assert_equal 3 (minMaxGame [115040532; 691122985; 74905644; 691122985; 74905644; 488737920; 409049507; 691122985; 74905644; 424016316; 139550887; 488737920; 409049507; 778486804; 581936863; 691122985; 74905644; 898320970; 424016316; 316332152; 322747948; 139550887; 10127500; 488737920; 409049507; 714000633; 529661213; 778486804; 581936863; 766268468; 256616097; 691122985; 893168349; 74905644; 898320970; 562091841; 623374598; 424016316; 316332152; 175024652; 322747948; 421471664; 139550887; 27323869; 10127500; 285386703; 54510532; 488737920; 920450369; 409049507; 714000633; 376483632; 529661213; 689244382; 749711836; 778486804; 581936863; 952610726; 46933645; 766268468; 256616097; 930245976; 109029077; 691122985])17 18let test4 _ = assert_equal 3 (minMaxGame [422752264; 444626536; 383451709; 444626536; 964694290; 383451709; 444626536; 354937044])19 20let test5 _ = assert_equal 3 (minMaxGame [347432181; 347432181; 347432181; 253225415])21 22let test6 _ = assert_equal 3 (minMaxGame [277872296; 945927896; 351536846; 945927896; 351536846; 505308252; 355276338; 945927896; 351536846; 740924939; 38550376; 505308252; 355276338; 720623023; 50265300; 945927896; 351536846; 818710986; 268024035; 740924939; 38550376; 917469833; 218828997; 505308252; 355276338; 675186659; 272427923; 720623023; 50265300; 349134637; 197930247; 945927896; 351536846; 933128750; 89429569; 818710986; 268024035; 630711263; 740924939; 442693871; 38550376; 987228952; 110075355; 917469833; 218828997; 825822362; 168084080; 505308252; 355276338; 930388442; 188207825; 675186659; 272427923; 816044008; 613681487; 720623023; 50265300; 918806830; 349134637; 278273618; 197930247; 846327293; 114080947; 945927896; 351536846; 962339954; 153247899; 933128750; 89429569; 949890359; 736501846; 818710986; 268024035; 936649815; 630711263; 623451241; 740924939; 784006358; 364968461; 442693871; 38550376; 827637389; 775002894; 987228952; 110075355; 898363618; 496412781; 917469833; 218828997; 775423695; 299108265; 825822362; 168084080; 655056704; 55736741; 505308252; 355276338; 822549513; 165382074; 930388442; 188207825; 623202735; 97039735; 675186659; 272427923; 899139750; 58820112; 816044008; 613681487; 692107265; 446140510; 720623023; 50265300; 786653476; 631607382; 918806830; 738179041; 349134637; 3081800; 278273618; 197930247; 814391196; 846327293; 839751160; 114080947; 766307757; 394016082; 945927896; 842046573; 351536846; 581539229; 962339954; 153247899; 893052643; 933128750; 886264387; 237453609; 89429569; 168548190; 949890359; 736501846; 874536926; 390388306; 818710986; 268024035; 930890158; 936649815; 787292160; 630711263; 790680442; 623451241; 528577751; 757668896; 740924939; 540340338; 784006358; 364968461; 634924643; 442693871; 402084206; 38550376; 50388559; 486527953; 827637389; 889740846; 775002894; 987228952; 711758512; 110075355; 554558129; 898363618; 430338156; 855273022; 496412781; 917469833; 513275787; 287567580; 218828997; 775423695; 544183099; 960564854; 299108265; 403334797; 825822362; 168084080; 420433761; 257316455; 655056704; 614047974; 55736741; 55437983; 505308252; 355276338; 829117431; 425539800; 822549513; 473149306; 165382074; 930388442; 219356010; 188207825; 221601673; 339915824; 623202735; 97039735; 643265311; 675186659; 302235312; 801212847; 272427923; 899139750; 473530827; 701114055; 58820112; 103017505; 816044008; 613681487; 819740209; 623887143; 692107265; 446140510; 818007276; 45103587; 720623023; 50265300; 236708934; 646052908; 786653476; 631607382; 943759801; 918806830; 256451102; 738179041; 798967010; 56615261; 349134637; 3081800; 585996046; 278273618; 187195679; 365793711; 197930247; 814391196; 1711047; 846327293; 989073716; 454322636; 839751160; 803562099; 114080947; 656466739; 766307757; 829671791; 394016082; 945927896; 556552137])23 24let test7 _ = assert_equal 3 (minMaxGame [439363306; 983086361; 18639521; 983086361; 18639521; 926360015; 429073836; 983086361; 18639521; 618347797; 331389171; 926360015; 429073836; 823614485; 206463919; 983086361; 18639521; 551614501; 528697263; 618347797; 729566617; 331389171; 806609119; 926360015; 429073836; 906955449; 28743328; 823614485; 575701114; 206463919; 430845510; 983086361; 18639521; 476762353; 551614501; 483033277; 528697263; 757187572; 618347797; 289394534; 930884662; 729566617; 331389171; 248606565; 828364048; 806609119; 104101301; 926360015; 586131558; 429073836; 124381100; 906955449; 871344524; 28743328; 372630435; 823614485; 575701114; 898787203; 206463919; 11428664; 430845510; 479380797; 101634865; 983086361])25 26 27 (* Grouping test cases *)28 let suite = "Test Suite for minMaxGame" >::: [29 30 "test1" >:: test1;31 "test2" >:: test2;32 "test3" >:: test3;33 "test4" >:: test4;34 "test5" >:: test5;35 "test6" >:: test6;36 "test7" >:: test7;37 ]38 39 40 (* Running the tests *)41 let () = run_test_tt_main suite42end43 