Datasets:

Modalities:
Text
Formats:
json
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
License:
Dataset Viewer
Auto-converted to Parquet
task_id
stringlengths
1
30
buggy_code
stringlengths
162
2.31k
fixed_code
stringlengths
162
2.31k
prompt
stringlengths
134
1.35k
unit_tests
stringlengths
317
8.03M
is_palindrome
/* Checks if given string is a palindrome >>> is_palindrome("") true >>> is_palindrome("aba") true >>> is_palindrome("aaaaa") true >>> is_palindrome("zbcd") false */ #include<stdio.h> #include<string> using namespace std; bool is_palindrome(string text){ string pr(text.rbegin(),text.rend()-1); return pr==text; }
/* Checks if given string is a palindrome >>> is_palindrome("") true >>> is_palindrome("aba") true >>> is_palindrome("aaaaa") true >>> is_palindrome("zbcd") false */ #include<stdio.h> #include<string> using namespace std; bool is_palindrome(string text){ string pr(text.rbegin(),text.rend()); return pr==text; }
/* Checks if given string is a palindrome >>> is_palindrome("") true >>> is_palindrome("aba") true >>> is_palindrome("aaaaa") true >>> is_palindrome("zbcd") false */ #include<stdio.h> #include<string> using namespace std; bool is_palindrome(string text){
#undef NDEBUG #include<assert.h> int main(){ assert (is_palindrome("") == true); assert (is_palindrome("aba") == true); assert (is_palindrome("aaaaa") == true); assert (is_palindrome("zbcd") == false); assert (is_palindrome("xywyx") == true); assert (is_palindrome("xywyz") == false); assert (is_palindrome("xywzx") == false); assert(is_palindrome("") == true); assert(is_palindrome("aba") == true); assert(is_palindrome("aaaaa") == true); assert(is_palindrome("zbcd") == false); assert(is_palindrome("xywyx") == true); assert(is_palindrome("xywyz") == false); assert(is_palindrome("xywzx") == false); assert(is_palindrome("a") == true); assert(is_palindrome("ab") == false); assert(is_palindrome("abc") == false); assert(is_palindrome("abca") == false); assert(is_palindrome("racecar") == true); assert(is_palindrome("radar") == true); assert(is_palindrome("refer") == true); assert(is_palindrome("bab") == true); assert(is_palindrome("aabc") == false); assert(is_palindrome("aabca") == false); assert(is_palindrome("reacecar") == false); assert(is_palindrome("frefer") == false); assert(is_palindrome("abbcc") == false); assert(is_palindrome("abbc") == false); assert(is_palindrome("abcaabca") == false); assert(is_palindrome("rar") == true); assert(is_palindrome("babb") == false); assert(is_palindrome("abbbc") == false); assert(is_palindrome("aa") == true); assert(is_palindrome("nXHRf") == false); assert(is_palindrome("babbabcca") == false); assert(is_palindrome("baabbcbbabcca") == false); assert(is_palindrome("aaacaracecar") == false); assert(is_palindrome("rr") == true); assert(is_palindrome("baabbcbbbcca") == false); assert(is_palindrome("abb") == false); assert(is_palindrome("abbccc") == false); assert(is_palindrome("aaaabca") == false); assert(is_palindrome("reefer") == false); assert(is_palindrome("ba") == false); assert(is_palindrome("aaacar") == false); assert(is_palindrome("babbccaabbcbbabcca") == false); assert(is_palindrome("reefrer") == false); assert(is_palindrome("racecrar") == false); assert(is_palindrome("abbbbc") == false); assert(is_palindrome("baabbcbbabcbabbabccaca") == false); assert(is_palindrome("baabbcbbabcbabbcabccaca") == false); assert(is_palindrome("babbbbc") == false); assert(is_palindrome("raaefer") == false); assert(is_palindrome("babcabccaca") == false); assert(is_palindrome("baracecrarbbccaabbcbbabcca") == false); assert(is_palindrome("reaaefer") == false); assert(is_palindrome("foeman,") == false); assert(is_palindrome("Panama") == false); assert(is_palindrome("Taco") == false); assert(is_palindrome("Evil") == false); assert(is_palindrome("or") == false); assert(is_palindrome("is") == false); assert(is_palindrome("Step") == false); assert(is_palindrome("canal:") == false); assert(is_palindrome("12zZ2@@@@!@3Taco") == false); assert(is_palindrome("notj") == false); assert(is_palindrome("lilve.at") == false); assert(is_palindrome("see") == false); assert(is_palindrome("God?") == false); assert(is_palindrome("li.lve.a.t") == false); assert(is_palindrome("d3!@@@2name1") == false); assert(is_palindrome("Able") == false); assert(is_palindrome("Evistarl") == false); assert(is_palindrome("ord3!@@@2Zz21oeman,") == false); assert(is_palindrome("d3!@@@2Zz21oeman,") == false); assert(is_palindrome("ere") == true); assert(is_palindrome("lEvil") == false); assert(is_palindrome("geesea") == false); assert(is_palindrome("parssaw?") == false); assert(is_palindrome("al:") == false); assert(is_palindrome("eere") == false); assert(is_palindrome("cEvilnot") == false); assert(is_palindrome("12zZ2") == false); assert(is_palindrome("geeseaea") == false); assert(is_palindrome("satar") == false); assert(is_palindrome("on") == false); assert(is_palindrome("Evisttarl") == false); assert(is_palindrome("man,Taco") == false); assert(is_palindrome("Tacco") == false); assert(is_palindrome("vil") == false); assert(is_palindrome("TTacco") == false); assert(is_palindrome("PanamaTaco") == false); assert(is_palindrome("d3!@@@2Zz21nama.") == false); assert(is_palindrome("f12zZ2@@@@!3") == false); assert(is_palindrome("pssawd3!@@@@2Zz21oeman,?") == false); assert(is_palindrome("no") == false); assert(is_palindrome("Tlive.Tacco") == false); assert(is_palindrome("lWas") == false); assert(is_palindrome("sawa") == false); assert(is_palindrome("TTPanamTacoaTacoacco") == false); assert(is_palindrome("12zZaTaco") == false); assert(is_palindrome("geese") == false); assert(is_palindrome("Panama.") == false); assert(is_palindrome("PanamTacoaTac") == false); assert(is_palindrome("@@@@!33j") == false); assert(is_palindrome("d3!@@@@2Zz21oeman,") == false); assert(is_palindrome("12zZaTcaco") == false); assert(is_palindrome("dd3!@@@2DoZz213!@@@2Zz21nama.") == false); assert(is_palindrome("Taocco") == false); assert(is_palindrome("geeseaa") == false); assert(is_palindrome("gese") == false); assert(is_palindrome("nottj") == false); assert(is_palindrome("12zZWas") == false); assert(is_palindrome("Tac") == false); assert(is_palindrome("1oeman,") == false); assert(is_palindrome("d3!@@@2Zz21") == false); assert(is_palindrome("S") == true); assert(is_palindrome("SS") == true); assert(is_palindrome("ee") == true); assert(is_palindrome("SS12zZ2@@@@!@3Taco") == false); assert(is_palindrome("not") == false); assert(is_palindrome("of") == false); assert(is_palindrome("SSS") == true); assert(is_palindrome("Was") == false); assert(is_palindrome("sis") == true); assert(is_palindrome("m1oeman,") == false); assert(is_palindrome("sYvzbv") == false); assert(is_palindrome("geesd3!@@@@2Zz21oeman,aa") == false); assert(is_palindrome("saw?") == false); assert(is_palindrome("d3!@@@z21") == false); assert(is_palindrome("lW") == false); assert(is_palindrome("live.at") == false); assert(is_palindrome("Panaama") == false); assert(is_palindrome("f12zZ2@@@man,A") == false); assert(is_palindrome("Taococo") == false); assert(is_palindrome("cEvilcnot") == false); assert(is_palindrome("12zZ2co") == false); assert(is_palindrome("canal:Able") == false); assert(is_palindrome("12zZ2@@@@!3j") == false); assert(is_palindrome("EvElba.name1il") == false); assert(is_palindrome("EvisttcananWAarl") == false); assert(is_palindrome("nootj") == false); assert(is_palindrome("Elba.") == false); assert(is_palindrome("PanamTacoaTaco") == false); assert(is_palindrome("@@@@!3j") == false); assert(is_palindrome("m112zZWasoeman,") == false); assert(is_palindrome("wsaw") == false); assert(is_palindrome("d3!@@@2me1") == false); assert(is_palindrome("d3!@@@2Zzeman,") == false); assert(is_palindrome("1Ws") == false); assert(is_palindrome("live.a") == false); assert(is_palindrome("f12zZ2@") == false); assert(is_palindrome("live") == false); assert(is_palindrome("d3!@@@@2Zz213oeman,") == false); assert(is_palindrome("livee.a") == false); assert(is_palindrome("1zZaTaco") == false); assert(is_palindrome("Dd3!@@@2DoZz21o") == false); assert(is_palindrome("PanamTaacoaTaco") == false); assert(is_palindrome("l.a") == false); assert(is_palindrome("erecaisnral,Dd3!@@@2DoZz21o") == false); assert(is_palindrome("cEviilnot") == false); assert(is_palindrome("d3!@@@2Zeman,") == false); assert(is_palindrome("ord3!@@@2Zz21oeman,Able") == false); assert(is_palindrome("Tacooo") == false); assert(is_palindrome("manf12zZ2@@@man,A,Taco") == false); assert(is_palindrome("d3!@@@@2Zz213dd3!@@@2DoZz213!@@@2Zz21nama.oeman,") == false); assert(is_palindrome("plan,") == false); assert(is_palindrome("c") == true); assert(is_palindrome("cl:") == false); assert(is_palindrome("Tacaot") == false); assert(is_palindrome("Ia") == false); assert(is_palindrome("Panama.sLmxhinkamaor") == false); assert(is_palindrome("a12zZ2g@eeseaea@@@@!31Tacoman,") == false); assert(is_palindrome("ges") == false); assert(is_palindrome("pmlan,,") == false); assert(is_palindrome("notefoeman,") == false); assert(is_palindrome("noc") == false); assert(is_palindrome("live.aZz21oeman,") == false); assert(is_palindrome("geseeseaea") == false); assert(is_palindrome("12zZ2geeseaea@@@@!3Tacoman,") == false); assert(is_palindrome("Elba.?") == false); assert(is_palindrome("erecainWAsnral,Dd3!@@@2DoZz21o") == false); assert(is_palindrome("12zZ2@@@@!3Taco") == false); assert(is_palindrome("wliveas") == false); assert(is_palindrome("ll.a") == false); assert(is_palindrome("12zZ2@@@@!@3TacPanamTacoaTacan,") == false); assert(is_palindrome("iis") == false); assert(is_palindrome("oTaococo") == false); assert(is_palindrome("erecaisn@ral,Dd3!@@@2DoZ,z21o") == false); assert(is_palindrome("ll.aGod?") == false); assert(is_palindrome("was") == false); assert(is_palindrome("f12zZ!3") == false); assert(is_palindrome("d3!@@@@2Zz21oemnamean,") == false); assert(is_palindrome("foemplaWasan,") == false); assert(is_palindrome("122zZ2") == false); assert(is_palindrome("petssaw?n,") == false); assert(is_palindrome("Panama.d3!@@@2Zz21nama.a!@3Taco") == false); assert(is_palindrome("1WeenWPanama..A") == false); assert(is_palindrome("saw?petsecaisnral,") == false); assert(is_palindrome("awa") == true); assert(is_palindrome("orTTacco") == false); assert(is_palindrome("cEcvilcnot") == false); assert(is_palindrome("EvisttcananWAaarl") == false); assert(is_palindrome("plannWA") == false); assert(is_palindrome("Panama..") == false); assert(is_palindrome("Panama.sLmxhinkmaor") == false); assert(is_palindrome("si") == false); assert(is_palindrome("Dd3!1o") == false); assert(is_palindrome("canacEvilnlEvilotl:Able") == false); assert(is_palindrome("n") == true); assert(is_palindrome("orrTaTacco") == false); assert(is_palindrome("eEvisttcananWAarlere") == false); assert(is_palindrome("Panama.d3!@@@z21") == false); assert(is_palindrome("nnn") == true); assert(is_palindrome("d3!@@@@2Zz213oemaan,") == false); assert(is_palindrome("manf12zZ2@@@amanTaco") == false); assert(is_palindrome("man,ATacogeesea") == false); assert(is_palindrome("Panama.sLmxhinkma") == false); assert(is_palindrome("llW") == false); assert(is_palindrome("geesd3!@@@noc@2Zz21oeman,aa") == false); assert(is_palindrome("1WeAanama..A") == false); assert(is_palindrome("it") == false); assert(is_palindrome("no@tj") == false); assert(is_palindrome("livea") == false); assert(is_palindrome("Panama.sLmxahink2Zeman,") == false); assert(is_palindrome("1zZczaTaco") == false); assert(is_palindrome("geesd3!@@@noc@2Zz21oea") == false); assert(is_palindrome("geesd3!@@@noc@2Zz21oemaaa") == false); assert(is_palindrome("man,ATacoeesea") == false); assert(is_palindrome("eEvisattcanarlere") == false); assert(is_palindrome("pml,an,,") == false); assert(is_palindrome("canalA") == false); assert(is_palindrome("pannWA") == false); assert(is_palindrome("Panama.sLmxad3!@@@Tacocathink2Zeman,") == false); assert(is_palindrome("ofoeman,as") == false); assert(is_palindrome("Panama.sLmxhink,") == false); assert(is_palindrome("I") == true); assert(is_palindrome("Panama.Was") == false); assert(is_palindrome("iStepis") == false); assert(is_palindrome("Panama.asLmxhinkma") == false); assert(is_palindrome("wssaw") == false); assert(is_palindrome("LWzOuT") == false); assert(is_palindrome("1ereacaisnral,zZczaTaco") == false); assert(is_palindrome("planl,") == false); assert(is_palindrome("Panaaama") == false); assert(is_palindrome("ggese") == false); assert(is_palindrome("Tacogeesea") == false); assert(is_palindrome("12zZaTacco") == false); assert(is_palindrome("petsesaw?n,") == false); assert(is_palindrome("PanPama") == false); assert(is_palindrome("d3!@@@2@DoZz2") == false); assert(is_palindrome("erre") == true); assert(is_palindrome("Panama.sLmxhhink,") == false); assert(is_palindrome("live.ata") == false); assert(is_palindrome("parssawa?") == false); assert(is_palindrome("sapw?petsecaisnral,") == false); assert(is_palindrome("@@@@EvTaco!33j") == false); assert(is_palindrome("Evivl") == false); assert(is_palindrome("lvEvil") == false); assert(is_palindrome("petrssaSStep") == false); assert(is_palindrome("lofoeman,W") == false); assert(is_palindrome("dd3!@@@2DoZz213!@@@2Zz21naPanama.sLmxhinkma.") == false); assert(is_palindrome("ld3!@@@2Zz21nama.l.a") == false); assert(is_palindrome("live.atil") == false); assert(is_palindrome("cEivil") == false); assert(is_palindrome("gaQLMzyB") == false); assert(is_palindrome("p12zZ2@d3!@@@Tacocat@@@@A") == false); assert(is_palindrome("Iiere") == false); assert(is_palindrome("leivee.a") == false); assert(is_palindrome("live.atn,a") == false); assert(is_palindrome("man,nWA") == false); assert(is_palindrome("r") == true); assert(is_palindrome("Panama.caisnral,") == false); assert(is_palindrome("EvisWas") == false); assert(is_palindrome("12zZZ2") == false); assert(is_palindrome("cEcvilccnot") == false); assert(is_palindrome("e.a") == false); assert(is_palindrome("EDBeGUgzCE") == false); assert(is_palindrome("PanamaTaconotS") == false); assert(is_palindrome("erPanama.Panamalnotre") == false); assert(is_palindrome("12zZ12") == false); assert(is_palindrome("hpetsecaisnral,122zZ2") == false); assert(is_palindrome("Dere") == false); assert(is_palindrome("WRiQwNNUK") == false); assert(is_palindrome("man,ATacoge12zZ2geeseaea@@@@!3Tacoman,efoemord3!@@@2Zz21oeman,AAblean,sea") == false); assert(is_palindrome("12zZaTaccliveo") == false); assert(is_palindrome("Panama.d3!@@@2Zzeman,ma.PanamalnotsLmxhink,") == false); assert(is_palindrome("d3!@@@Ta") == false); assert(is_palindrome("awaa") == false); assert(is_palindrome("2notjWassattar") == false); assert(is_palindrome("pets,f12zZ2@@@man,A") == false); assert(is_palindrome("a12zZ2geeseaea@@@@!3Tacoman,") == false); assert(is_palindrome("lofWoeman,W") == false); assert(is_palindrome("ma12zZ2geeseaea@@@@!3Tacoman,") == false); assert(is_palindrome("12zZ2@@@@!@3TacZz2112zZ2@@@@!@3Taco") == false); assert(is_palindrome("Tacno@tjo") == false); assert(is_palindrome("canalpetssawAbleA") == false); assert(is_palindrome("star") == false); assert(is_palindrome("ca?t") == false); assert(is_palindrome("a12zZ2geeseaea@@@@z!3Tacoman,aLL") == false); assert(is_palindrome("ca") == false); assert(is_palindrome("f,12zZ2@d3!@@@2eZeman,") == false); assert(is_palindrome("d3!@@@2DoZz2112zZ2@@@@!@3Taco") == false); assert(is_palindrome("d3!parssaw?@@@2Zz21e") == false); assert(is_palindrome("ld3!Z@@@2Zz21nama.l.a") == false); assert(is_palindrome("taco") == false); assert(is_palindrome("md3!@@@2Zeman,Tacoe2notjWassattaresea") == false); assert(is_palindrome("lEvilf12zZ2@@@man,A") == false); assert(is_palindrome("manf12zZ2@@@manTaco") == false); assert(is_palindrome("leiv12zZaTaccoee.a") == false); assert(is_palindrome("saw?p,etsecaisnriisal,") == false); assert(is_palindrome("!") == true); assert(is_palindrome("z") == true); assert(is_palindrome("12zZ2@@@@!j3j") == false); assert(is_palindrome("12zZ2@@3@@!j3j") == false); assert(is_palindrome("12zZ2@@3@@!jfoeman,3j") == false); assert(is_palindrome("A") == true); assert(is_palindrome("12zZ2@@@evilj") == false); assert(is_palindrome("cat") == false); assert(is_palindrome("live.") == false); assert(is_palindrome("Rats") == false); assert(is_palindrome("lieve.") == false); assert(is_palindrome("foem,an,") == false); assert(is_palindrome("Aorcatgees,Panamae") == false); assert(is_palindrome("wsaww") == false); assert(is_palindrome("erel") == false); assert(is_palindrome("12zZerel") == false); assert(is_palindrome("foemaIn,Step") == false); assert(is_palindrome("s?aw?") == false); assert(is_palindrome("AeNO") == false); assert(is_palindrome("foem,acatn,") == false); assert(is_palindrome("wsawww") == false); assert(is_palindrome("foeem,an,") == false); assert(is_palindrome("foeem,noan,") == false); assert(is_palindrome("wswawww") == false); assert(is_palindrome("foeem,,an,") == false); assert(is_palindrome("as") == false); assert(is_palindrome("12zZ@@@!j3") == false); assert(is_palindrome("PaaPanama") == false); assert(is_palindrome("Rtats") == false); assert(is_palindrome("saw?12@zZ2@@@@!3j") == false); assert(is_palindrome("Pana.ma..") == false); assert(is_palindrome("aas") == false); assert(is_palindrome("12zPaaPanamaZ2@@@evilj") == false); assert(is_palindrome("saw??") == false); assert(is_palindrome("car") == false); assert(is_palindrome("12zZ2@@@@!2j3jd3!@@@2Zz21") == false); assert(is_palindrome("Do") == false); assert(is_palindrome("12zZ21") == false); assert(is_palindrome("1@2zZ2@@@evilj") == false); assert(is_palindrome("Panam.a.") == false); assert(is_palindrome("ncanal,") == false); assert(is_palindrome("PA") == false); assert(is_palindrome("HijEVmHx") == false); assert(is_palindrome("joOnfO") == false); assert(is_palindrome("RtatRs") == false); assert(is_palindrome("ncanalfoem,an,,") == false); assert(is_palindrome("12zZ2it@@2A") == false); assert(is_palindrome("Panamano") == false); assert(is_palindrome("maPa") == false); assert(is_palindrome("PanPana,manoamano") == false); assert(is_palindrome("122zPaaPanamael") == false); assert(is_palindrome("12zZ2a21") == false); assert(is_palindrome("Iba.") == false); assert(is_palindrome("egeese") == false); assert(is_palindrome("joOngeesefO") == false); assert(is_palindrome("foemaIn,SPanasee.ma.p") == false); assert(is_palindrome("foeIem,noan,") == false); assert(is_palindrome("Ablba.") == false); assert(is_palindrome("Panasee.ma.") == false); assert(is_palindrome("staTaco") == false); assert(is_palindrome("wwas") == false); assert(is_palindrome("Pana.ma...") == false); assert(is_palindrome("Ky") == false); assert(is_palindrome("Pana.ma..PaA.") == false); assert(is_palindrome("Step12zZ2petssaw@@@@!3j") == false); assert(is_palindrome("Pana,mano") == false); assert(is_palindrome("Pana.ma.") == false); assert(is_palindrome("f,oe!em,noaan,") == false); assert(is_palindrome("Was12zZ2@@@@!j3j") == false); assert(is_palindrome("wsaAeNA") == false); assert(is_palindrome("12zZ2@@j@@!j3jd3!@@@2Zz21") == false); assert(is_palindrome("T12zZ2Panama21aco") == false); assert(is_palindrome("foeman,Step") == false); assert(is_palindrome("ncanalfoem,an,a,") == false); assert(is_palindrome("Steman,p12zZ2pets@@@@@!3j") == false); assert(is_palindrome("foemaaIn,SPanasee.ma.p") == false); assert(is_palindrome("PanPana,Pao") == false); assert(is_palindrome("s?a") == false); assert(is_palindrome("Ablba.PA") == false); assert(is_palindrome("joOngeesecacnal,ifO") == false); assert(is_palindrome("12zZ2a21erel") == false); assert(is_palindrome("fofoemaIn,StepeIaem,noan,") == false); assert(is_palindrome("staTaTco") == false); assert(is_palindrome("12zZ2@@@@!Able") == false); assert(is_palindrome("lieeve.") == false); assert(is_palindrome("foeem,nor") == false); assert(is_palindrome("foeman,Smtep") == false); assert(is_palindrome("Go") == false); assert(is_palindrome("ncanoalfoem,an,,") == false); assert(is_palindrome("Pa.na.ma..") == false); assert(is_palindrome("T12zZ2Panama21acoDoe") == false); assert(is_palindrome("12zZ2Panama21") == false); assert(is_palindrome("sa??") == false); assert(is_palindrome("Pana.ma.oeman,") == false); assert(is_palindrome("sa???") == false); assert(is_palindrome("Pana.ma.a") == false); assert(is_palindrome("liaa.ma..") == false); assert(is_palindrome(",PanaPanasee.ma.tsma") == false); assert(is_palindrome("egeeese") == false); assert(is_palindrome("o") == true); assert(is_palindrome("12zZas2@@j@@!j3jd3!@@@2Zz21") == false); assert(is_palindrome("12zZ2a21ereel") == false); assert(is_palindrome("R") == true); assert(is_palindrome("stTco") == false); assert(is_palindrome("fofoeSmaIn,StepeIaem,noan,") == false); assert(is_palindrome("12zZ2@@j@@!j3jd3!@z@@2Zz2lieveA") == false); assert(is_palindrome("12zZ@2@@3@@!j3j") == false); assert(is_palindrome("eNO") == false); assert(is_palindrome("12a3") == false); assert(is_palindrome("PanamanPaAo") == false); assert(is_palindrome("manm.,") == false); assert(is_palindrome("12zZ2@@@@!@3j") == false); assert(is_palindrome("ssa???") == false); assert(is_palindrome("nm.,") == false); assert(is_palindrome("hLSbYVmk") == false); assert(is_palindrome("Kyy") == false); assert(is_palindrome("122zPaaaPana2mael") == false); assert(is_palindrome("wswaww") == false); assert(is_palindrome("fIoem,an,I") == false); assert(is_palindrome("Ablbba.") == false); assert(is_palindrome("KyDo") == false); assert(is_palindrome("12zZas2@@j@@!j3jd3z21") == false); assert(is_palindrome("geeeGse") == false); assert(is_palindrome("scatPaa???") == false); assert(is_palindrome("Pana.mPa.") == false); assert(is_palindrome("12zzZ2@@j@@!j3jd3!@@@2Zz21") == false); assert(is_palindrome("aPana,mZ2@@Aorcatgees,Panplan,Elbaa.ama12zZ2it@@2Az21,") == false); assert(is_palindrome("PAno") == false); assert(is_palindrome("canal12zZ2@") == false); assert(is_palindrome("manm.,wwas") == false); assert(is_palindrome("pnl,an,") == false); assert(is_palindrome("Pana.maa.a") == false); assert(is_palindrome("canal12zZ2@@Aor2catgees,Panplan,Elbaa.ama12zZ2it@@2Az21,Kyy") == false); assert(is_palindrome("foem,anm,") == false); assert(is_palindrome("lieveA") == false); assert(is_palindrome("d3d!@@@2Zz2!1") == false); assert(is_palindrome(",aPanA") == false); assert(is_palindrome("Panaanama.ma.") == false); assert(is_palindrome("canal,") == false); assert(is_palindrome("nama21ets@@@@!3j") == false); assert(is_palindrome("Elbaa.j") == false); assert(is_palindrome("foemaIn,SjoOngeesefOPanasee.ma.p") == false); assert(is_palindrome("manmcacnal,i.,wwas") == false); assert(is_palindrome("A.") == false); assert(is_palindrome("12zZ2a211") == false); assert(is_palindrome("saw?1on2@zZ2@@@@!3jj") == false); assert(is_palindrome("Aogrcatgees,Panamae") == false); assert(is_palindrome("man,") == false); assert(is_palindrome("pets") == false); assert(is_palindrome("ws12zZ2@@j@@!j3jd3!@@@2Zz21waww") == false); assert(is_palindrome("KyDo12zZ2@@@@!2j3jd3!@@@2Zz21") == false); assert(is_palindrome("foemaPanPana,manoamanon,") == false); assert(is_palindrome("S2tep12z12zPaaPanamaZ2@@@2eviljZ3j") == false); assert(is_palindrome("Aorcatgees,PafoemaIn,SjoOngeesefOPanasee.ma.pnamae") == false); assert(is_palindrome("12@zZ12zZ2@@@@!23j") == false); assert(is_palindrome("wswawwere") == false); assert(is_palindrome("saw?e") == false); assert(is_palindrome("12zZas2@@j@@!j3jd3!@@@2fIoem,an,I") == false); assert(is_palindrome("sa????") == false); assert(is_palindrome("f,oe122zPaaPanamael!em,naoaan,") == false); assert(is_palindrome("HijEVmHHx") == false); assert(is_palindrome("fem,an,") == false); assert(is_palindrome("foetm,acaton,") == false); assert(is_palindrome("fIoemalieveAn,") == false); assert(is_palindrome("EYk") == false); assert(is_palindrome("12zZ2@@j@@!j312zZas2@@j@@!j3jd3!@@@2Zz21jd3!@z@@2Zz2lieveA") == false); assert(is_palindrome("122zPaaaPannwswawwAa2mael") == false); assert(is_palindrome("fofoeSmaIn,SteIaem,noan,") == false); assert(is_palindrome("RR") == true); assert(is_palindrome("Pana.mao.oeman,") == false); assert(is_palindrome("12zZ2Panama212@@@@!@3j") == false); assert(is_palindrome("12zZ2Pzanama212@@@@!@3j") == false); assert(is_palindrome(",PanaPanasee.ma.ts") == false); assert(is_palindrome("wsawwww") == false); assert(is_palindrome("HjiEjEHVmHHx") == false); assert(is_palindrome("egrykPqA") == false); assert(is_palindrome("Pana.ma.on,") == false); assert(is_palindrome("fIoeman,s") == false); assert(is_palindrome("w?e12zZ2@@j@@!j3jd3!@@@2Zz21Go1aco") == false); assert(is_palindrome("Elba.j") == false); assert(is_palindrome("pnnl,an,") == false); assert(is_palindrome("wswawwerecar") == false); assert(is_palindrome("KyDoDoe") == false); assert(is_palindrome("aas12zZ2@@3@@!jfoeman,3j") == false); assert(is_palindrome("Panasee.ma.ts") == false); assert(is_palindrome("12zZ2@@3@@!j33Able") == false); assert(is_palindrome("wsaAeNT12zZ2Panama2T12zZ2Panama21acoDoe") == false); assert(is_palindrome("PanPan,Pao") == false); assert(is_palindrome("foaem,an,") == false); assert(is_palindrome("wwswaww") == false); assert(is_palindrome("scatPaa??") == false); assert(is_palindrome("liaa.ma..fIoeman,2Step12zZ2pjets@@@@!3jI") == false); assert(is_palindrome("O") == true); assert(is_palindrome("foeIemwsaAeNA,noan,") == false); assert(is_palindrome("OQdpFdbUIt") == false); assert(is_palindrome("f,oe!em,") == false); assert(is_palindrome("catPa") == false); assert(is_palindrome("foeIemwsaAmanm.,wwaseNA,fIoeman,I") == false); assert(is_palindrome("wsaAeNAa") == false); assert(is_palindrome("12zZ2@@3@@!j3312zZ2@@j@@!j3jd3!@@@2Zz212@@@@lieveAAble") == false); assert(is_palindrome("cccat") == false); assert(is_palindrome(",aPa,nA") == false); assert(is_palindrome("lliKyyeveA") == false); assert(is_palindrome("Panaccat.ma..") == false); assert(is_palindrome("T12zZ2PaDoe") == false); assert(is_palindrome("canal12zZ2@@Aorcatgees,PanPana.ma..1Goamae@@!2j3jd3!A@@@2Zz21,") == false); assert(is_palindrome("namZ2pets@@@@!3jI") == false); assert(is_palindrome("KyD") == false); assert(is_palindrome("petsPanamaean.,") == false); assert(is_palindrome("feofoeSmaIn,StepeIaem,noan,") == false); assert(is_palindrome("S2tep12@zZ12zZ2@@@@!23j12z12zPaaPanamaZ2@@@2eviljZ3j") == false); assert(is_palindrome("?sa???") == false); assert(is_palindrome("g") == true); assert(is_palindrome("12zPaaPanamaZ2@P@@evilj") == false); assert(is_palindrome(",Pannasee.ma.tsma") == false); assert(is_palindrome("foemaIn,SPanaseme.ma.p") == false); assert(is_palindrome("pnl,an,canal12zZ2@@Aorcatgees,PanPana.ma..1Goamae@@!2j3jd3!A@@@2Zz21,") == false); assert(is_palindrome("Aorcatgees,PafoemaIn,S12zZ@2@@3@@!j3jjoOngeesefOPanasee.ma.pnamae") == false); }
car_race_collision
/* Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions. */ #include<stdio.h> using namespace std; int car_race_collision(int n){ return n; }
/* Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions. */ #include<stdio.h> using namespace std; int car_race_collision(int n){ return n*n; }
/* Imagine a road that's a perfectly straight infinitely long line. n cars are driving left to right; simultaneously, a different set of n cars are driving right to left. The two sets of cars start out being very far from each other. All cars move in the same speed. Two cars are said to collide when a car that's moving left to right hits a car that's moving right to left. However, the cars are infinitely sturdy and strong; as a result, they continue moving in their trajectory as if they did not collide. This function outputs the number of such collisions. */ #include<stdio.h> using namespace std; int car_race_collision(int n){
#undef NDEBUG #include<assert.h> int main(){ assert (car_race_collision(2) == 4); assert (car_race_collision(3) == 9); assert (car_race_collision(4) == 16); assert (car_race_collision(8) == 64); assert (car_race_collision(10) == 100); assert (car_race_collision(2) == 4); assert (car_race_collision(3) == 9); assert (car_race_collision(4) == 16); assert (car_race_collision(8) == 64); assert (car_race_collision(10) == 100); assert (car_race_collision(5) == 25); assert (car_race_collision(6) == 36); assert (car_race_collision(12) == 144); assert (car_race_collision(15) == 225); assert (car_race_collision(20) == 400); assert (car_race_collision(1) == 1); assert (car_race_collision(25) == 625); assert (car_race_collision(7) == 49); assert (car_race_collision(100) == 10000); assert (car_race_collision(500) == 250000); assert (car_race_collision(24) == 576); assert (car_race_collision(101) == 10201); assert (car_race_collision(14) == 196); assert (car_race_collision(99) == 9801); assert (car_race_collision(23) == 529); assert (car_race_collision(19) == 361); assert (car_race_collision(47) == 2209); assert (car_race_collision(48) == 2304); assert (car_race_collision(46) == 2116); assert (car_race_collision(26) == 676); assert (car_race_collision(499) == 249001); assert (car_race_collision(27) == 729); assert (car_race_collision(98) == 9604); assert (car_race_collision(28) == 784); assert (car_race_collision(18) == 324); assert (car_race_collision(45) == 2025); assert (car_race_collision(498) == 248004); assert (car_race_collision(13) == 169); assert (car_race_collision(102) == 10404); assert (car_race_collision(11) == 121); assert (car_race_collision(17) == 289); assert (car_race_collision(501) == 251001); assert (car_race_collision(68) == 4624); assert (car_race_collision(21) == 441); assert (car_race_collision(30) == 900); assert (car_race_collision(10000) == 100000000); assert (car_race_collision(1000) == 1000000); assert (car_race_collision(1002) == 1004004); assert (car_race_collision(97) == 9409); assert (car_race_collision(9999) == 99980001); assert (car_race_collision(22) == 484); assert (car_race_collision(29) == 841); assert (car_race_collision(10001) == 100020001); assert (car_race_collision(16) == 256); assert (car_race_collision(31) == 961); assert (car_race_collision(9998) == 99960004); assert (car_race_collision(89) == 7921); assert (car_race_collision(44) == 1936); assert (car_race_collision(9997) == 99940009); assert (car_race_collision(1003) == 1006009); assert (car_race_collision(83) == 6889); assert (car_race_collision(43) == 1849); assert (car_race_collision(84) == 7056); assert (car_race_collision(59) == 3481); assert (car_race_collision(58) == 3364); assert (car_race_collision(999) == 998001); assert (car_race_collision(998) == 996004); assert (car_race_collision(57) == 3249); assert (car_race_collision(997) == 994009); assert (car_race_collision(996) == 992016); assert (car_race_collision(56) == 3136); assert (car_race_collision(9) == 81); assert (car_race_collision(55) == 3025); assert (car_race_collision(92) == 8464); assert (car_race_collision(50) == 2500); assert (car_race_collision(42) == 1764); assert (car_race_collision(54) == 2916); assert (car_race_collision(53) == 2809); assert (car_race_collision(87) == 7569); }
solution
/* Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions. Examples solution({5, 8, 7, 1}) ==> 12 solution({3, 3, 3, 3, 3}) ==> 9 solution({30, 13, 24, 321}) ==>0 */ #include<stdio.h> #include<vector> using namespace std; int solutions(vector<int> lst){ int sum=0; for (int i=0;i*2<lst.size();i++) if (lst[i*2]%2==0) sum+=lst[i*2]; return sum; }
/* Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions. Examples solution({5, 8, 7, 1}) ==> 12 solution({3, 3, 3, 3, 3}) ==> 9 solution({30, 13, 24, 321}) ==>0 */ #include<stdio.h> #include<vector> using namespace std; int solutions(vector<int> lst){ int sum=0; for (int i=0;i*2<lst.size();i++) if (lst[i*2]%2==1 or lst[i*2]%2==-1) sum+=lst[i*2]; printf("%d\n", sum); return sum; }
/* Given a non-empty vector of integers, return the sum of all of the odd elements that are in even positions. Examples solution({5, 8, 7, 1}) ==> 12 solution({3, 3, 3, 3, 3}) ==> 9 solution({30, 13, 24, 321}) ==>0 */ #include<stdio.h> #include<vector> using namespace std; int solutions(vector<int> lst){
#undef NDEBUG #include<assert.h> int main(){ assert (solutions({5, 8, 7, 1}) == 12); assert (solutions({3, 3, 3, 3, 3}) == 9); assert (solutions({30, 13, 24, 321}) == 0); assert (solutions({5, 9}) == 5); assert (solutions({2, 4, 8}) == 0); assert (solutions({30, 13, 23, 32}) == 23); assert (solutions({3, 13, 2, 9}) == 3); assert(solutions({5,8,7,1}) == 12); assert(solutions({3,3,3,3,3}) == 9); assert(solutions({30,13,24,321}) == 0); assert(solutions({5,9}) == 5); assert(solutions({2,4,8}) == 0); assert(solutions({30,13,23,32}) == 23); assert(solutions({3,13,2,9}) == 3); assert(solutions({1,2,3,4,5,6}) == 9); assert(solutions({0,1,2,3,4,5,6,7}) == 0); assert(solutions({2,5,10,11,18}) == 0); assert(solutions({1,3,5,7}) == 6); assert(solutions({2,3,5,8,13}) == 18); assert(solutions({2,4,6,8,10}) == 0); assert(solutions({1,1,1,1,1,1}) == 3); assert(solutions({7}) == 7); assert(solutions({2,1,2,1,2,1}) == 0); assert(solutions({0,0,0,0,1}) == 1); assert(solutions({2,5,10,11,11}) == 11); assert(solutions({2,4,0,6,8,1}) == 0); assert(solutions({2,10,11,18}) == 11); assert(solutions({2,1,2,1,2,2,1}) == 1); assert(solutions({2,7,1,2,1,2,1}) == 3); assert(solutions({1,2,3,4,5}) == 9); assert(solutions({2,5,10,11,2,11,11}) == 11); assert(solutions({1,1,1,3,4,5,5,7}) == 7); assert(solutions({4,10,11,18}) == 11); assert(solutions({1,2,3,13,5,6}) == 9); assert(solutions({2,1,2,1,2,2,1,2}) == 1); assert(solutions({2,3,4,5}) == 0); assert(solutions({13,5,10,11,2,11,11}) == 24); assert(solutions({2,5,11,2,11,11}) == 22); assert(solutions({2,1,2,6,2,1}) == 0); assert(solutions({0,1,3,5,7,5}) == 10); assert(solutions({2,7,1,2,3,1,2,1,2}) == 4); assert(solutions({1,3,2,7}) == 1); assert(solutions({2,7,1,2,3,1,2,1,2,2}) == 4); assert(solutions({2,1,2,2,1,2}) == 1); assert(solutions({2,4,8,10}) == 0); assert(solutions({0,1,2,3,5,6,7,2}) == 12); assert(solutions({1,2,1,2,1,2,2,1,2}) == 3); assert(solutions({2,5,10,11,2,11}) == 0); assert(solutions({2,3,5,13,5}) == 10); assert(solutions({6,10,11,18}) == 11); assert(solutions({0,0,10,0,1}) == 1); assert(solutions({2,7,4,8,10}) == 0); assert(solutions({7,2,10,11,10,18}) == 7); assert(solutions({2,3,5,8,12}) == 5); assert(solutions({1,1,1,1}) == 2); assert(solutions({2,7,1,2,3,1,11,13,2,1,2,2}) == 15); assert(solutions({2,3,5,13,13}) == 18); assert(solutions({2,1,2,1,2,1,1}) == 1); assert(solutions({0,1,2,3,4,5,6,7,6}) == 0); assert(solutions({4,10,11,18,18}) == 11); assert(solutions({12,13}) == 0); assert(solutions({2,5,10,11,11,2,11}) == 22); assert(solutions({2,3,5,8,13,13}) == 18); assert(solutions({2,5,6,11,2,11,11,2}) == 11); assert(solutions({2,1,3,1,2}) == 3); assert(solutions({7,1,2,3,1,2,1,2}) == 9); assert(solutions({2,5,10,11,11,2,11,2}) == 22); assert(solutions({0,3,5,7,5,7}) == 10); assert(solutions({2,1,2,6,2,1,1,1}) == 1); assert(solutions({1,2,4,5,6}) == 1); assert(solutions({1,3,13,14,5,6}) == 19); assert(solutions({10,2,3,13,5,6,2}) == 8); assert(solutions({10,2,14,3,13,5,6}) == 13); assert(solutions({0,5,2,7,5,7,2}) == 5); assert(solutions({2,5,10,11,11,2,11,2,11}) == 33); assert(solutions({3,2,7}) == 10); assert(solutions({2,5,10,11,2,11,11,2}) == 11); assert(solutions({0,1,0,0,0,1}) == 0); assert(solutions({1,3,3,13,14,5,18}) == 4); assert(solutions({0,1,3,7,5}) == 8); assert(solutions({2,4,5,13,5,5}) == 10); assert(solutions({1,1,1,10,3,4,5,5,7}) == 17); assert(solutions({4,10,11,18,10}) == 11); assert(solutions({0,3,5,7,5}) == 10); assert(solutions({2,8,10,10}) == 0); assert(solutions({0,1,2,3,11,4,5,6,7}) == 23); assert(solutions({2,2,5,10,11,11}) == 16); assert(solutions({1,1,1,10,3,4,5,5,7,4}) == 17); assert(solutions({2,4,7,8,10}) == 7); assert(solutions({2,1,2,0,1,2,12,1}) == 1); assert(solutions({1,2,1,2,2,1,2}) == 2); assert(solutions({1,2,10,2,2}) == 1); assert(solutions({2,7,4,8,10,10}) == 0); assert(solutions({5,3,4,5}) == 5); assert(solutions({0,1,3,2,7}) == 10); assert(solutions({5,3,5,4,5}) == 15); assert(solutions({2,6,1,2,6,2,1,1,1,1}) == 3); assert(solutions({1,2,3,4,5,6,7,6}) == 16); assert(solutions({6,12,13}) == 13); assert(solutions({1,4,7,8,10}) == 8); assert(solutions({2,5,10,11,11,11}) == 11); assert(solutions({5,11,10,11,2,11}) == 5); assert(solutions({2,5,10,12,11,11,11,11}) == 22); assert(solutions({0,10,0,1,0}) == 0); assert(solutions({13,5,10,11,2,11,11,10}) == 24); assert(solutions({1,2,3,4,5,6,5}) == 14); assert(solutions({0,10,0,1,0,1}) == 0); assert(solutions({1,3,2,1,2,2,1,2}) == 2); assert(solutions({1,2,4,5,6,1,6}) == 1); assert(solutions({2,5,10,11,2,11,11,10,5,5}) == 16); assert(solutions({2,1,3,2}) == 3); assert(solutions({2,5,10,11,11,2}) == 11); assert(solutions({0,0,0,13}) == 0); assert(solutions({2,3,4,5,6,7,8,9,10}) == 0); assert(solutions({1,4,1,4,1,4,1,4}) == 4); assert(solutions({2,2,2,1,1,1,5,5,5}) == 11); assert(solutions({0,0,0,0,0,0,0,0}) == 0); assert(solutions({11,22,33,44,55,66,77,88,99}) == 275); assert(solutions({1,1,1,1,1,1,1,1,1}) == 5); assert(solutions({0,1,2,3,4,5,6,7,8}) == 0); assert(solutions({2,3,4,5,6,9,8,11,10}) == 0); assert(solutions({31,42,53,64,75,86,97,108,119}) == 375); assert(solutions({0,1,2,3,4,5,6,7,8,9,10}) == 0); assert(solutions({65,11,22,33,44,55,66,77,88,99}) == 65); assert(solutions({0,2,3,4,5,6,7,8,9,10}) == 24); assert(solutions({2,5,2,2,1,1,1,5,5,5,1}) == 8); assert(solutions({65,22,33,44,55,66,77,88}) == 230); assert(solutions({1,1,1,1,1,1,1,1,1,1}) == 5); assert(solutions({2,2,1,1,1,5,5,5}) == 7); assert(solutions({2,3,4,6,9,8,11,10}) == 20); assert(solutions({2,2,1,1,1,5,5,5,5}) == 12); assert(solutions({0,1,2,3,4,5,6,7,9,2}) == 9); assert(solutions({0,1,2,3,4,5,6,7,8,9,2}) == 0); assert(solutions({2,3,4,5,6,7,8,9,31,10}) == 31); assert(solutions({11,22,33,44,55,66,88,99}) == 99); assert(solutions({2,1,1,1,5,5,5}) == 11); assert(solutions({2,2,2,1,1,1,5,5}) == 6); assert(solutions({2,3,4,9,8,11,10}) == 0); assert(solutions({2,3,4,4,6,9,8,11,10}) == 0); assert(solutions({2,3,4,5,6,8,9,31,10}) == 9); assert(solutions({65,22,44,55,66,77}) == 65); assert(solutions({1,4,1,1,4,1,4}) == 2); assert(solutions({65,11,22,33,44,55,66,77,88,77,99}) == 164); assert(solutions({2,11,3,4,5,88,6,9,8,11,10,8}) == 8); assert(solutions({2,3,4,4,6,9,8,11,10,8}) == 0); assert(solutions({12,22,33,44,55,66,77,88,99}) == 264); assert(solutions({2,3,4,9,8,11}) == 0); assert(solutions({2,11,3,4,4,6,9,8,11,10,8}) == 23); assert(solutions({0,0,0,0,0,0,0,0,0}) == 0); assert(solutions({3,3,4,4,6,9,8,11,10,8}) == 3); assert(solutions({1,2,2,1,1,1,5,5}) == 7); assert(solutions({86,2,3,4,5,6,7,8,9,10}) == 24); assert(solutions({65,22,33,55,66,77,88}) == 98); assert(solutions({1,1,1,1,1,1,1,1,1,1,1}) == 6); assert(solutions({1,11,1,1,4,1,4,1}) == 2); assert(solutions({3,3,4,4,6,9,12,8,11,10,8}) == 14); assert(solutions({11,22,33,44,65,55,66,88,99,22}) == 208); assert(solutions({3,1,1,1,5,5,5}) == 14); assert(solutions({2,5,2,2,1,1,1,5,5,5,1,1,5}) == 13); assert(solutions({75,1,2,3,4,5,6,7,9,2}) == 84); assert(solutions({1,55,2,2,1,1,1,5,5,1}) == 8); assert(solutions({2,2,2,44,1,1,5,5,5}) == 11); assert(solutions({99,1,4,1,4,1,4,1,4}) == 99); assert(solutions({0,0,0,0,0,0,0}) == 0); assert(solutions({86,2,3,4,4,5,6,7,8,9,10}) == 3); assert(solutions({11,12,22,33,44,55,66,77,88,99}) == 11); assert(solutions({3,3,4,4,6,9,12,8,11,33,8}) == 14); assert(solutions({75,1,2,3,4,5,6,7,9,2,4}) == 84); assert(solutions({86,2,3,4,4,6,7,8,9,10}) == 19); assert(solutions({75,1,2,4,4,5,6,7,9,2,4}) == 84); assert(solutions({12,22,33,44,55,44,77,88,99,77}) == 264); assert(solutions({2,11,3,4,5,88,6,9,8,55,11,10,8,8}) == 19); assert(solutions({11,22,33,56,44,65,55,66,88,99,22,22}) == 99); assert(solutions({1,1,1,1,1,1,1,1}) == 4); assert(solutions({1,2,2,6,1,77,1,1,5,1,5}) == 13); assert(solutions({3,3,4,4,6,9,12,8,11,10,8,9}) == 14); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,1}) == 102); assert(solutions({3,4,4,6,9,12,8,11,33,8}) == 45); assert(solutions({3,3,4,4,6,9,12,8,11,10,9,8,10}) == 23); assert(solutions({1,1,1,1,1,1,1,5,1,1}) == 5); assert(solutions({11,12,22,33,44,55,66,77,0,88,99}) == 110); assert(solutions({86,2,3,4,5,6,7,8,53,9,10}) == 68); assert(solutions({2,3,4,5,6,9,9,31,10,2}) == 9); assert(solutions({33,1,1,1,1,1,1,1,5,1,1,1}) == 42); assert(solutions({0,1,1,1,1,1,1,97,1,1,1}) == 5); assert(solutions({2,1,4,1,4,5,1,5}) == 1); assert(solutions({2,11,3,3,4,6,9,8,11,10,8}) == 23); assert(solutions({3,3,4,4,6,9,7,11,10,44}) == 10); assert(solutions({3,4,6,9,8,11,10}) == 3); assert(solutions({2,5,2,2,1,1,1,5,5,5,1,1,5,5}) == 13); assert(solutions({2,2,2,1,1,55,5}) == 6); assert(solutions({0,1,2,3,5,6,7,8,9,10}) == 21); assert(solutions({2,3,4,9,9,11,2,10}) == 9); assert(solutions({11,22,33,44,65,55,66,88,99,22,22}) == 208); assert(solutions({11,22,33,55,66,88,99}) == 143); assert(solutions({3,3,4,6,9,12,8,11,10,9,8,10}) == 12); assert(solutions({1,11,1,1,4,1,4,1,1}) == 3); assert(solutions({11,12,22,33,44,55,66,77,88,99,55}) == 66); assert(solutions({75,1,2,3,4,5,6,7,9,2,4,1}) == 84); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,1,1}) == 103); assert(solutions({0,1,2,3,3,4,5,6,7,9,2}) == 15); assert(solutions({75,1,2,3,4,6,7,9,2,4}) == 82); assert(solutions({76,1,2,4,4,5,6,7,9,2,4}) == 9); assert(solutions({2,3,4,6,8,9,31}) == 31); assert(solutions({1,0,1,1,1,1,1,1,1,1,1,1}) == 6); assert(solutions({1,1,1,2,1,1,1,1,97,1,1,1}) == 102); assert(solutions({2,5,6,2,2,1,1,1,5,5,5,1,1,5}) == 12); assert(solutions({3,3,3,4,4,6,9,12,8,11,10,8,9,11}) == 24); assert(solutions({1,55,2,2,1,1,1,5,5,33,1}) == 9); assert(solutions({75,1,2,4,5,6,7,9,2,4}) == 87); assert(solutions({2,3,4,4,6,9,8,11,10,8,4,6}) == 0); assert(solutions({1,1,1,2,1,1,1,1,1,97,1,1,1}) == 7); assert(solutions({86,2,2,4,4,5,6,7,8,9,10}) == 0); assert(solutions({2,2,1,1,1,0,5,5,5}) == 12); assert(solutions({2,11,3,4,5,88,9,8,11,10}) == 28); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,0,1,1}) == 103); assert(solutions({11,22,33,44,6,65,55,66,88,99,22,22}) == 99); assert(solutions({11,22,33,6,65,55,66,88,99,22,22,65}) == 208); assert(solutions({0,1,2,3,4,5,6,7,8,9,10,4,9}) == 9); assert(solutions({56,11,3,4,5,88,9,8,55,11,10,8,8}) == 72); assert(solutions({0,53,2,3,5,6,7,8,9,10}) == 21); assert(solutions({3,3,3,4,4,6,9,3,12,8,11,10,8,9,11}) == 37); assert(solutions({31,42,53,64,5,76,86,97,108,119}) == 89); assert(solutions({3,3,4,4,6,9,12,8,11,10,10,8,10,12}) == 14); assert(solutions({2,11,0,4,4,6,9,8,11,10,8}) == 20); assert(solutions({11,22,33,44,55,66,88,99,22}) == 99); assert(solutions({3,3,3,4,4,6,9,12,8,12,10,8,9,11}) == 24); assert(solutions({1,1,1,1,1,1,1,5,1,8,1,1,1}) == 7); assert(solutions({1,55,2,2,1,1,1,5,5,1,1}) == 9); assert(solutions({2,11,3,4,5,88,5,9,8,55,11,8,8}) == 24); assert(solutions({2,2,2,1,1,1,5,5,5,1}) == 11); assert(solutions({2,3,4,4,6,9,44,11,10}) == 0); assert(solutions({0,1,2,3,5,6,7,8,9,10,4,9}) == 21); assert(solutions({12,22,33,44,55,44,77,88,99,77,77}) == 341); assert(solutions({75,119,2,3,64,6,7,9,2,4}) == 82); assert(solutions({0,1,2,3,0,4,5,6,7,8,0}) == 12); assert(solutions({99,1,4,1,1,4,1,4}) == 101); assert(solutions({3,3,4,4,4,12,8,33,8}) == 3); assert(solutions({2,3,4,4,6,9,11,10,8,4,6}) == 11); assert(solutions({2,1,1,1,4,5,5,5,5}) == 11); assert(solutions({2,11,3,3,88,6,9,8,11,10,8,3}) == 23); assert(solutions({2,2,2,1,1,5,5,1,5}) == 11); assert(solutions({2,3,4,6,65,8,11,10,8,4,6}) == 76); assert(solutions({1,1,1,108,1,1,1,1,1,97,1,1,1}) == 7); assert(solutions({2,10,3,4,5,6,7,8,9,31,10}) == 24); assert(solutions({1,1,1,2,1,1,1,1,22,1,1,1,1}) == 6); assert(solutions({3,3,4,4,4,12,8,33,9}) == 12); assert(solutions({1,1,1,77,12,1,1,1,1,97,1,1,1}) == 6); assert(solutions({11,22,33,44,65,55,66,88,99,22,22,33}) == 208); assert(solutions({2,5,2,2,1,1,1,5,5,5,6,1,5}) == 12); assert(solutions({0,2,3,4,5,6,7,8,77,10}) == 92); assert(solutions({99,1,4,1,4,1,4,22,1,4}) == 100); assert(solutions({2,1,1,1,1,4,5,5,5,5}) == 12); assert(solutions({1,4,1,4,1,4,1}) == 4); assert(solutions({0,1,2,3,9,5,6,7,8,9,10}) == 9); assert(solutions({2,2,2,1,1,2,5,5,5}) == 11); assert(solutions({2,11,3,4,5,88,5,9,8,11,8,66}) == 13); assert(solutions({10,12,22,33,44,55,66,77,88,99}) == 0); assert(solutions({2,4,2,4,5,1,5}) == 10); assert(solutions({3,4,4,6,9,12,8,11,32,8,8}) == 12); assert(solutions({65,56,22,33,44,55,66,77,88}) == 65); assert(solutions({65,11,65,22,33,44,55,66,77,88,77,99,10}) == 372); assert(solutions({0,1,2,3,4,6,7,8,9,10}) == 16); assert(solutions({99,1,4,1,1,4,1,4,1}) == 102); assert(solutions({2,11,3,4,5,88,5,76,55,11,8,8}) == 68); assert(solutions({2,2,1,1,1,5,5,5,5,5}) == 12); assert(solutions({0,1,2,3,4,5,6,7,8,9}) == 0); assert(solutions({12,22,33,86,55,44,32,76,88,99,77,77}) == 165); assert(solutions({3,3,4,4,6,9,12,8,11,10,8,9,6}) == 14); assert(solutions({0,1,1,1,1,1,97,1,1,1,1}) == 101); assert(solutions({11,22,33,44,65,55,66,88,99,22,65}) == 273); assert(solutions({1,55,2,2,1,1,1,1,5,5,33,1}) == 41); assert(solutions({2,1,1,1,2,1,1,1,1,22,1,1,1,1}) == 5); assert(solutions({2,5,2,2,33,1,1,5,5,5,42,1,1,5,5}) == 45); assert(solutions({2,3,4,9,9,11,2,2,10}) == 9); assert(solutions({1,1,1,1,1,1,1}) == 4); assert(solutions({1,0,1,1,1,1,1,1,1,0,1,1,1,0}) == 7); assert(solutions({0,0,0,0,0,0}) == 0); assert(solutions({1,4,1,1,4,1,4,1}) == 2); assert(solutions({1,1,1,1,1,1,1,22,1,1,1,1}) == 6); assert(solutions({2,3,4,3,6,44,11,10,44}) == 11); assert(solutions({2,2,2,1,1,1,5,5,5,1,1,5}) == 12); assert(solutions({1,1,44,1,44,1,1,1,1,1,97,1,1,1}) == 101); assert(solutions({11,22,33,44,65,55,66,88,99,0,22,33,88}) == 208); assert(solutions({2,4,2,4,5,1,5,2}) == 10); assert(solutions({1,1,1,108,1,1,1,1,1,97,1,1,119,1}) == 125); assert(solutions({0,1,2,3,6,7,8,9,10,5,2}) == 0); assert(solutions({2,4,3,4,6,1,5,2}) == 8); assert(solutions({75,119,2,3,64,6,9,7,9,2,4}) == 93); assert(solutions({65,10,22,33,44,55,76,66,77,88,22,33}) == 142); assert(solutions({11,22,32,44,6,65,55,66,88,99,64,22,22}) == 66); assert(solutions({3,3,4,4,42,7,11,10,32,44}) == 14); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,0,1,1,1}) == 104); assert(solutions({1,0,1,1,1,1,1,1,1,0,1,1,1,0,0}) == 7); assert(solutions({86,2,3,4,5,6,6,7,8,53,10}) == 8); assert(solutions({1,1,1,1,1,1,1,1,1,32,1}) == 6); assert(solutions({11,21,33,44,65,55,89,66,88,99,22,65}) == 198); assert(solutions({31,42,53,5,76,86,97,108,119}) == 300); assert(solutions({12,11,22,33,6,65,55,66,88,99,22,22,65,88}) == 120); assert(solutions({1,1,1,1,1,1,22,1,1,1,1}) == 5); assert(solutions({2,4,5,6,7,8,9,31,10}) == 21); assert(solutions({2,4,2,4,6,1,5,2}) == 5); assert(solutions({75,1,2,4,5,6,7,9,2,4,1}) == 88); assert(solutions({2,5,2,2,1,1,1,5,21,5,5,1}) == 28); assert(solutions({31,42,53,5,86,97,108}) == 84); assert(solutions({3,3,4,4,42,7,10,32,44}) == 3); assert(solutions({2,11,3,4,5,88,5,76,55,11,8,8,8}) == 68); assert(solutions({1,4,1,4,2,1,4,1,4,4,4}) == 2); assert(solutions({86,2,21,4,4,6,7,8,9,10,7}) == 44); assert(solutions({3,3,4,4,6,9,12,11,10,8,9}) == 12); assert(solutions({4,4,77,4,6,9,12,8,11,33,8,33,9}) == 97); assert(solutions({33,11,2,33,44,65,55,66,88,99,0,22,33,88}) == 121); assert(solutions({11,22,33,44,65,54,66,88,99,22,22,33,22}) == 208); assert(solutions({2,3,4,6,44,11,10,44}) == 0); assert(solutions({0,1,2,3,4,5,6,7,97,9,2}) == 97); assert(solutions({0,1,1,1,1,1,1,64,97,1,1,1,1}) == 102); assert(solutions({0,53,2,3,6,5,75,7,8,9,10}) == 75); assert(solutions({11,22,33,44,65,55,66,88,99,77,22,22,99}) == 307); assert(solutions({11,22,33,44,55,32,66,77,88,99}) == 99); assert(solutions({65,11,65,22,33,44,55,66,77,88,77,99,10,77,88}) == 372); assert(solutions({76,22,33,100,44,65,55,66,88,99,0,22,33,88}) == 121); assert(solutions({1,3,4,2,4,5,1,5}) == 2); assert(solutions({22,33,100,65,55,66,56,99,21,0,22,33,88}) == 76); assert(solutions({1,1,1,2,1,1,1,1,22,1,1,1,1,2}) == 6); assert(solutions({11,22,33,44,65,55,66,88,56,99,0,22,33,88}) == 142); assert(solutions({1,1,1,1,1,1,1,5,1,1,1}) == 6); assert(solutions({0,1,2,3,5,7,7,8,9,10}) == 21); assert(solutions({86,2,2,4,4,5,6,7,8,9,10,9}) == 0); assert(solutions({0,53,2,3,5,6,8,9,10}) == 5); assert(solutions({1,1,1,1,1,1,1,5,1,8,108,1,1}) == 6); assert(solutions({0,1,1,1,1,1,97,1,1,0,1}) == 101); assert(solutions({2,2,2,1,1,1,5,5,2}) == 6); assert(solutions({0,1,2,3,100,5,6,7,8,9,10,4,9,7}) == 9); assert(solutions({31,11,53,64,5,76,86,97,108,119}) == 89); assert(solutions({1,1,1,1,1,1,1,1,98,1,1,1,1}) == 6); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,1,1,1}) == 103); assert(solutions({0,1,2,3,5,6,7,8,9,10,4}) == 21); assert(solutions({100,2,3,3,6,44,11,10,44,100}) == 14); assert(solutions({11,22,33,44,54,66,88,99,22,22,33,22,22}) == 77); assert(solutions({2,11,3,4,9,8,11,10}) == 23); assert(solutions({86,2,3,65,5,6,42,53,77,9,10}) == 85); assert(solutions({2,11,0,4,10,4,6,9,8,11,10,8}) == 0); assert(solutions({75,75,2,3,4,5,6,7,9,2}) == 84); assert(solutions({76,3,1,2,4,4,5,6,10,9,1,4}) == 7); assert(solutions({0,1,2,54,3,4,5,6,7,9,10}) == 15); assert(solutions({2,11,0,4,10,4,4,6,9,8,11,10,8}) == 20); assert(solutions({0,2,3,4,5,6,7,8,10}) == 15); assert(solutions({2,2,44,1,1,5,5,5}) == 6); assert(solutions({0,1,2,5,6,7,8,9,10,9}) == 0); assert(solutions({2,2,1,31,2,5,5,5}) == 6); assert(solutions({86,2,2,4,4,5,6,7,8,9,10,5}) == 0); assert(solutions({99,1,4,1,4,1,4,1,4,1}) == 99); assert(solutions({2,3,4,6,6,7,8,9,10,6}) == 0); assert(solutions({3,3,4,4,6,9,8,11,10,8,9}) == 12); assert(solutions({11,22,33,44,54,66,88,99,22,22,66,33,22,22,22,33}) == 44); assert(solutions({11,22,33,44,55,66,77,88,99,77}) == 275); assert(solutions({5,3,3,4,4,4,12,8,33,8,4}) == 41); assert(solutions({2,66,3,4,6,65,8,11,10,8,4,6,8}) == 3); assert(solutions({2,3,4,4,45,6,9,44,11,10}) == 65); assert(solutions({9,3,3,4,33,4,42,7,10,32,44}) == 45); assert(solutions({1,100,1,56,1,1,1,1,1,99,1}) == 6); assert(solutions({11,21,33,44,65,89,66,88,86,99,22,65}) == 109); assert(solutions({11,22,33,44,54,66,88,99,22,22,33,22,22,22}) == 77); assert(solutions({2,11,0,4,10,4,4,6,9,8,11,10,6,10}) == 20); assert(solutions({3,1,1,1,5,100,5,5}) == 14); assert(solutions({0,1,2,3,4,5,6,7,8,9,2,2}) == 0); assert(solutions({3,3,4,6,9,8,11,10,8,9}) == 23); assert(solutions({2,11,3,4,5,88,6,9,8,11,10,8,4}) == 8); assert(solutions({11,22,33,44,6,65,55,66,99,22,22,22}) == 198); assert(solutions({3,4,6,9,12,8,11,33,8,8}) == 14); assert(solutions({3,3,4,4,6,9,12,8,11,33,8,12}) == 14); assert(solutions({1,1,2,1,1,1,1,22,1,1,1,1,2,1}) == 5); assert(solutions({3,4,6,21,12,8,11,100,8,8,9}) == 23); assert(solutions({2,3,4,5,4,6,8,9,31,10}) == 31); assert(solutions({1,1,1,1,1,53,1,1,1,1,32,1}) == 5); assert(solutions({99,1,4,1,4,0,1,4,22,1,4}) == 100); assert(solutions({2,3,4,11,6,44,11,10,44}) == 11); assert(solutions({2,3,4,4,6,9,8,11,10,2}) == 0); assert(solutions({3,0,1,2,3,5,6,7,8,9,10,4,2}) == 7); assert(solutions({2,1,1,1,2,1,1,1,97,1,1,1}) == 100); assert(solutions({86,2,3,4,4,6,7,8,9,31,10}) == 19); assert(solutions({98,1,2,4,5,6,7,9,2,4,1}) == 13); assert(solutions({2,1,1,1,1,4,5,5,5,5,1}) == 13); assert(solutions({0,1,2,3,3,4,5,7,9,2,7}) == 24); assert(solutions({2,11,3,3,88,6,9,8,11,10,8,3,2,2}) == 23); assert(solutions({2,1,1,1,2,1,1,1,97,1,1,1,1}) == 101); assert(solutions({2,11,4,10,4,6,9,8,11,10,8,8}) == 20); assert(solutions({31,11,53,64,5,76,86,97,108,119,31}) == 120); assert(solutions({1,1,1,1,1,1,1,98,0,1,1,1,1}) == 6); assert(solutions({12,22,34,86,55,44,32,76,99,77,77}) == 231); assert(solutions({3,4,4,6,9,108,8,11,33,8}) == 45); assert(solutions({75,1,2,11,5,6,7,9,2,4,1}) == 88); assert(solutions({0,1,1,1,1,1,1,1,97,1,1,1}) == 101); assert(solutions({86,2,3,4,5,6,7,9,10}) == 15); assert(solutions({2,1,3,1,1,5,5,5}) == 9); assert(solutions({2,2,2,1,1,2,5,5,6,5}) == 6); assert(solutions({65,1,4,1,4,0,1,4,22,1,4,1}) == 66); assert(solutions({3,4,6,8,9,31}) == 12); assert(solutions({2,2,1,1,5,5,5,2}) == 11); assert(solutions({11,22,32,44,6,64,55,66,88,99,64,22,22}) == 66); assert(solutions({2,2,1,31,2,6,5,5,5}) == 11); assert(solutions({1,1,1,1,1,2,1,1,1,32,1}) == 6); assert(solutions({0,1,2,3,4,4,6,7,8}) == 0); assert(solutions({1,0,1,2,54,3,4,5,6,7,9,10}) == 11); assert(solutions({74,1,2,11,5,6,7,9,2,4,1}) == 13); assert(solutions({2,10,3,4,5,6,7,8,9,31,10,2}) == 24); assert(solutions({12,11,22,33,6,65,55,98,66,88,22,22,65,88}) == 120); assert(solutions({12,22,32,44,55,66,77,88,99}) == 231); assert(solutions({10,22,34,33,44,54,66,99,22,22,66,33,22,22,22,33}) == 0); assert(solutions({2,1,2,5,5,5,2}) == 5); assert(solutions({3,3,9,4,4,6,9,12,8,11,10,10,8,10,12}) == 21); assert(solutions({1,0,1,1,1,1,1,1,5,1,8,1,1,1}) == 10); assert(solutions({0,1,2,3,4,6,7,97,9,2}) == 16); assert(solutions({45,22,33,44,65,55,66,88,99,22,65}) == 307); assert(solutions({11,33,44,55,66,88,99,0,22,33,88}) == 110); assert(solutions({0,2,3,0,6,8,9,10}) == 12); assert(solutions({3,3,4,4,6,6,9,7,11,10,44}) == 23); assert(solutions({1,1,1,1,1,1,1,1,0,1,1,1,0,0,1}) == 6); assert(solutions({2,2,2,1,1,2,5,5,6,5,2,5}) == 6); assert(solutions({3,3,3,4,6,9,12,8,12,10,8,9,11}) == 17); assert(solutions({9,65,22,33,44,66,77,88}) == 86); assert(solutions({2,5,2,2,1,1,1,5,5,6,1,1,5}) == 13); assert(solutions({2,2,1,1,5,5,5,2,1}) == 12); assert(solutions({12,22,33,44,55,44,77,88,99,77,77,44}) == 341); assert(solutions({2,3,4,9,9,11,2}) == 9); assert(solutions({2,11,3,4,5,88,6,9,8,11,10,8,4,8}) == 8); assert(solutions({2,11,3,4,9,8,11,10,3}) == 26); assert(solutions({11,22,33,100,55,66,77,88,99}) == 275); assert(solutions({55,0,1,2,3,4,4,5,6,7,8,9,10,4,9}) == 68); assert(solutions({4,4,77,4,6,9,12,8,11,33,8,33,9,4,11}) == 108); assert(solutions({2,11,3,4,5,88,6,9,77,8,55,11,10,8,9}) == 149); assert(solutions({4,4,77,4,6,9,12,8,11,33,8,33,33,9}) == 121); assert(solutions({2,4,1,4,5,1,5,2,2}) == 11); assert(solutions({0,1,2,3,4,5,6,7,8,9,10,32,9}) == 9); assert(solutions({31,42,53,5,86,97}) == 84); assert(solutions({2,11,0,10,4,4,6,9,8,11,10,8}) == 0); assert(solutions({12,11,22,65,6,65,55,66,88,99,22,22,65,88}) == 120); assert(solutions({11,22,33,44,54,66,88,99,22,22,4,22,22}) == 44); assert(solutions({33,1,1,1,1,1,1,1,1,1,1}) == 38); assert(solutions({1,1,1,2,1,1,1,1,1,97,1,97,1,1}) == 7); assert(solutions({3,3,4,10,4,42,7,11,10,32,44}) == 10); assert(solutions({22,33,44,66,88,99}) == 0); assert(solutions({3,3,4,4,6,9,12,8,11,34,8}) == 14); assert(solutions({2,4,3,4,4,6,9,8,11,10,2,11}) == 23); assert(solutions({1,55,2,2,1,1,1,119,5,33,1,1}) == 9); assert(solutions({2,2,2,1,1,1,5,45,2}) == 6); assert(solutions({65,67,11,23,98,33,44,55,66,77,88,77,99}) == 175); assert(solutions({11,22,33,44,65,55,66,3,88,99,22,22}) == 109); assert(solutions({31,42,53,5,87,97}) == 171); assert(solutions({2,11,0,4,10,4,4,6,9,77,11,10,6,10}) == 20); assert(solutions({45,21,33,65,55,64,88,99,22,65}) == 133); assert(solutions({2,2,31,2,5,5,5,5}) == 41); assert(solutions({75,1,2,3,4,5,22,6,7,9,2}) == 82); assert(solutions({4,1,55,2,2,1,0,1,1,5,5,33,1}) == 62); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,1,1,1,1}) == 104); assert(solutions({65,67,11,23,98,33,44,55,66,77,88,77,99,67}) == 175); assert(solutions({4,3,4,4,6,9,12,6,8,11,10,8,9,6}) == 9); assert(solutions({2,11,0,4,10,4,4,6,9,11,10,8}) == 9); assert(solutions({12,11,22,33,6,65,55,98,66,89,88,22,23,65,88,88}) == 78); assert(solutions({99,4,1,4,1,4,1,4}) == 102); assert(solutions({4,2,4,4,6,9,12,8,11,12,10,8}) == 11); assert(solutions({11,12,32,56,44,6,64,55,66,88,99,64,22,22}) == 110); assert(solutions({2,2,2,1,22,1,5,5}) == 5); assert(solutions({1,1,1,1,2,1,1,22,1,1,1,1,22}) == 5); assert(solutions({1,11,1,1,4,1,4,1,1,1,1}) == 4); assert(solutions({3,3,4,4,119,12,33,9}) == 155); assert(solutions({1,1,1,5,1,1,1,5,1,1}) == 5); assert(solutions({3,4,4,6,9,8,11,10,8,9}) == 23); assert(solutions({1,0,1,1,1,1,1,1,5,1,8,1,1,1,1}) == 11); assert(solutions({1,1,1,1,1,1,97,1,1,1}) == 101); assert(solutions({86,2,3,65,5,6,42,53,77,2,9,10}) == 94); assert(solutions({11,12,32,56,44,6,64,55,66,88,99,22,22,22}) == 110); assert(solutions({89,2,4,2,4,5,1,6,2}) == 90); assert(solutions({2,1,3,1,119,5,5,5}) == 127); assert(solutions({2,5,2,2,33,1,1,5,5,5,42,1,1,5,5,1,2,1}) == 45); assert(solutions({11,22,33,100,55,66,77,88,99,66}) == 275); assert(solutions({2,5,2,2,33,1,5,5,5,42,1,1,5,5}) == 49); assert(solutions({2,3,5,6,9,8,11,10}) == 25); assert(solutions({1,2,3,4,5,6,7,2}) == 16); assert(solutions({2,2,1,1,1,5,5,98,2}) == 7); assert(solutions({1,1,1,2,1,1,8,1,1,22,1,1,1,2}) == 6); assert(solutions({2,5,2,2,33,1,1,5,5,5,42,1,5,5}) == 44); assert(solutions({23,2,3,65,5,6,42,53,77,2,9,10}) == 117); assert(solutions({0,1,2,3,4,5,75,6,7,8}) == 82); assert(solutions({2,3,4,5,88,6,9,8,11,10,86}) == 20); assert(solutions({11,22,9,33,100,55,66,77,88,99,66}) == 20); assert(solutions({2,4,3,4,7,1,5,2}) == 15); assert(solutions({2,4,2,4,5,1,4,2,4}) == 5); assert(solutions({0,1,2,2,3,4,5,6,7,9,2}) == 15); assert(solutions({2,2,1,1,1,5,56,2}) == 2); assert(solutions({2,2,1,30,2,5,5,5}) == 6); assert(solutions({2,2,1,1,1,5,5,98,2,2}) == 7); assert(solutions({2,2,2,1,1,5,5,1}) == 6); assert(solutions({1,1,1,2,1,1,56,1,1,22,1,1,1,1,2}) == 6); assert(solutions({2,1,3,1,119,5,5,23,5}) == 132); assert(solutions({1,1,1,1,1,1,1,1,97,1,1,0,1,1,1,1}) == 104); assert(solutions({2,1,1,1,2,1,1,1,97,1,1,97}) == 100); assert(solutions({65,11,22,33,44,65,55,66,77,88,77,99}) == 274); assert(solutions({33,1,1,1,1,1,1,1,1,1,99,1}) == 136); assert(solutions({0,2,3,77,67,6,8,9,10}) == 70); assert(solutions({11,12,32,56,6,64,55,66,88,99,64,22,22}) == 66); assert(solutions({108,0,1,2,3,3,4,5,6,7,9,2}) == 13); assert(solutions({2,2,34,1,1,1,5,5,5,5,5,5}) == 16); assert(solutions({3,3,9,4,4,6,8,9,12,8,11,10,10,8,10,12}) == 23); assert(solutions({2,11,0,4,10,56,4,6,8,11,10,8}) == 0); assert(solutions({31,42,53,64,5,76,86,97,108,119,86}) == 89); assert(solutions({2,1,1,1,1,4,6,5,5,5,5,1}) == 12); assert(solutions({1,1,1,2,1,1,1,1,1,86,1,0,1}) == 7); assert(solutions({2,2,31,2,4,5,5,5,5}) == 41); assert(solutions({2,11,0,4,4,6,9,8,11,10,8,8,0,2}) == 20); assert(solutions({2,75,56,4,11,6,44,11,10,44}) == 11); assert(solutions({2,5,2,2,1,1,5,21,5,5,1}) == 12); assert(solutions({3,3,9,4,4,6,8,9,12,8,11,10,10,8,10,12,3}) == 26); assert(solutions({2,1,3,1,1,5,5,5,1}) == 10); assert(solutions({11,22,44,54,66,88,99,22,22,33,22,22}) == 110); assert(solutions({4,4,77,4,6,9,12,8,11,33,8,33,9,11}) == 97); assert(solutions({55,3,4,4,6,9,12,8,11,10,10,8,10,12,3}) == 69); assert(solutions({22,33,100,65,55,66,56,99,21,0,22,100,33,88}) == 109); assert(solutions({2,1,3,1,77,3,5,5}) == 85); assert(solutions({1,0,1,108,1,1,1,1,5,1,8,1,1,1,1,1}) == 11); assert(solutions({11,12,22,33,44,55,66,77,88,99,54,55}) == 11); assert(solutions({2,10,3,5,5,6,7,8,9,31,10}) == 24); assert(solutions({33,1,1,1,1,0,1,1,1,1,99,1}) == 136); assert(solutions({65,11,22,33,44,65,55,66,76,88,78,99}) == 120); assert(solutions({11,33,44,55,66,88,99,0,22,33,88,33}) == 110); assert(solutions({12,22,34,86,55,44,32,76,99,77,77,55}) == 231); assert(solutions({11,22,33,44,6,55,66,99,22,22,22,6}) == 44); assert(solutions({2,11,3,5,88,9,8,1,10}) == 3); assert(solutions({33,1,2,3,4,5,6,7,9,2}) == 42); assert(solutions({0,1,2,0,4,5,6,7,8,0}) == 0); assert(solutions({0,1,2,3,4,5,6,7,8,9,1,10}) == 1); assert(solutions({31,42,53,86,97,108}) == 181); assert(solutions({3,3,3,4,4,6,9,12,8,12,10,8,9,11,9,8}) == 33); assert(solutions({11,11,22,33,44,55,66,77,88,99}) == 11); assert(solutions({1,1,2,1,1,1,1,22,1,1,1,1,2,1,1}) == 6); assert(solutions({75,1,2,4,6,7,9,2,4}) == 84); assert(solutions({2,65,4,6,44,11,10,44}) == 0); assert(solutions({2,7,11,4,4,6,9,7,8,11,10,8}) == 20); assert(solutions({1,1,1,44,1,1,1,1,1}) == 5); assert(solutions({1,1,1,2,1,1,1,1,55,1,97,1,1,1}) == 157); assert(solutions({3,4,6,8,11,10}) == 14); assert(solutions({3,4,6,9,108,5,8,11,33,8}) == 36); assert(solutions({65,89,11,65,22,33,44,55,66,77,77,99,10,77,88}) == 153); assert(solutions({99,1,4,1,1,5,4,99}) == 100); assert(solutions({2,2,44,1,1,5,86,5,5}) == 6); assert(solutions({11,12,22,33,44,55,66,77,88,66,99,54,55}) == 165); assert(solutions({11,53,22,33,44,65,55,66,88,56,99,0,22,33,88}) == 165); assert(solutions({55,3,4,4,6,9,12,8,11,10,10,8,10,12,3,11}) == 69); assert(solutions({3,3,4,4,4,12,8,33,33,8}) == 36); assert(solutions({2,5,2,2,1,1,1,5,5,5,1,1,5,5,5}) == 18); assert(solutions({2,4,2,4,5,1,5,30}) == 10); assert(solutions({2,2,1,1,1,5,5,98,2,98}) == 7); assert(solutions({2,4,77,76,5,5,1,4,2,4}) == 83); assert(solutions({1,1,1,1,1,2,1,1,1,32,1,1}) == 6); assert(solutions({22,33,44,88,99,33}) == 99); assert(solutions({22,33,88,5,33,33}) == 33); assert(solutions({11,22,33,44,54,66,88,99,22,22,66,33,22,22,22,33,99}) == 143); assert(solutions({3,3,3,4,4,6,9,12,8,11,10,8,9,12}) == 24); assert(solutions({2,3,4,5,6,9,8,11}) == 0); assert(solutions({2,4,3,2,4,5,1,4,2,4}) == 4); assert(solutions({1,55,2,86,1,1,1,5,5,1,1}) == 9); assert(solutions({2,2,2,1,1,5,5,5,1,1,5,1}) == 12); assert(solutions({0,1,2,0,4,5,5,7,8,0}) == 5); assert(solutions({3,3,9,4,4,6,7,9,12,8,11,10,10,10,8,10,12,8}) == 30); assert(solutions({11,22,33,44,65,55,66,88,99,0,22,31,33,88}) == 241); assert(solutions({2,1,1,1,2,1,1,1,97,87,1,1,97}) == 197); assert(solutions({1,1,1,1,1,1,1,1,1,2,1}) == 6); assert(solutions({86,2,21,4,65,6,7,8,9,10,7,10}) == 109); assert(solutions({65,22,33,55,66,77,88,65}) == 98); assert(solutions({2,2,1,1,1,1,5,5,98,2}) == 7); assert(solutions({1,1,1,2,2,1,1,1,97,1,1,1}) == 101); assert(solutions({65,10,22,4,33,44,55,76,66,77,88,22,33}) == 186); assert(solutions({55,3,4,4,6,9,12,8,11,10,8,10,12,3,55}) == 121); assert(solutions({1,0,0,108,1,1,1,1,5,1,8,1,1,1,1,1}) == 10); assert(solutions({11,12,22,33,44,55,66,77,89,99,55,22}) == 155); assert(solutions({2,11,0,4,10,4,6,9,8,11,10,8,8}) == 0); assert(solutions({11,22,33,1,44,65,55,66,88,56,99,0,22,33,88}) == 198); assert(solutions({2,2,1,2,1,5,5,5,5}) == 12); assert(solutions({0,1,2,3,4,5,6,8}) == 0); assert(solutions({0,1,3,4,5,6,7,8,10,1}) == 15); assert(solutions({0,1,1,4,1,4,1,1,1,1}) == 4); assert(solutions({1,4,1,4,2,1,4,1,4,4,4,1}) == 2); assert(solutions({31,42,53,5,87,97,87,53}) == 258); assert(solutions({99,1,4,1,4,1,4,10,1,4}) == 100); assert(solutions({3,3,3,5,4,6,9,12,8,12,10,8,9,11}) == 24); assert(solutions({1,3,4,2,4,5,1,5,4}) == 2); assert(solutions({2,64,5,2,2,1,1,1,5,21,5,5,1}) == 17); assert(solutions({12,33,1,2,4,3,5,6,7,9,2}) == 13); assert(solutions({2,1,1,5,5,5}) == 6); assert(solutions({11,22,33,44,6,65,55,66,88,99,22}) == 99); assert(solutions({31,42,53,31,76,86,97,108,119}) == 300); assert(solutions({75,1,2,4,5,6,7,9,2,4,1,2,7}) == 95); assert(solutions({1,1,3,1,2,1,1,1,1,1,97,1,1,1}) == 104); assert(solutions({1,1,1,1,1}) == 3); assert(solutions({3,1,1,1,5,5,5,1}) == 14); assert(solutions({11,22,33,100,55,66,77,88}) == 176); assert(solutions({2,10,3,5,5,6,7,8,9,31,10,31}) == 24); assert(solutions({2,3,4,6,8,9,31,9}) == 31); assert(solutions({2,2,1,1,1,5,5,5,5,5,5,5}) == 17); assert(solutions({0,74,53,2,3,5,6,8,9,10}) == 65); assert(solutions({2,2,44,1,1,5,5}) == 6); assert(solutions({2,1,4,1,4,5,1,108}) == 1); assert(solutions({3,3,4,4,6,9,75,12,8,11,34,8,3}) == 81); assert(solutions({1,1,1,1,1,1,1,97,108,1,1,0,1,1,1}) == 7); assert(solutions({3,5,4,6,9,119,8,12,10,8,11}) == 23); assert(solutions({65,11,22,33,65,44,65,55,66,77,88,77,99,77,66}) == 294); assert(solutions({2,3,4,5,6,8,9,31,98}) == 9); assert(solutions({3,4,4,6,1,9,8,11,10,8,9}) == 13); assert(solutions({33,31,42,53,5,86,97}) == 135); assert(solutions({2,1,1,1,4,6,5,5,5,5,1}) == 12); assert(solutions({11,22,32,44,65,55,66,3,88,99,22,22}) == 76); assert(solutions({12,33,44,55,66,77,88,99}) == 0); assert(solutions({0,1,2,3,4,5,6,7,8,9,10,32,9,9}) == 9); assert(solutions({2,3,4,5,6,8,9,31,10,31}) == 9); assert(solutions({86,2,3,119,4,4,5,6,7,8,9,10}) == 24); assert(solutions({3,3,4,4,7,6,6,9,11,10,44,44}) == 21); assert(solutions({33,1,1,1,1,0,1,1,1,1,99,1,1}) == 137); assert(solutions({2,1,4,4,5,1,108,1}) == 5); assert(solutions({86,33,1,2,4,3,5,6,7,9,2}) == 13); assert(solutions({3,3,4,4,6,9,12,8,11,33,8,12,33}) == 47); assert(solutions({22,33,44,88,99,32}) == 99); assert(solutions({3,3,3,4,6,9,12,8,12,10,8,9,9,11}) == 15); assert(solutions({1}) == 1); assert(solutions({2,4,6}) == 0); assert(solutions({2,4,6,1,3,5}) == 3); assert(solutions({3,5,7,9,11}) == 21); assert(solutions({1,-2,5,0,-3}) == 3); assert(solutions({2,5,4,6,8}) == 0); assert(solutions({1,2,1,1,1,1,1,1}) == 4); assert(solutions({11,89,22,33,44,55,66,77,88,99}) == 11); assert(solutions({11,89,22,33,44,55,66,88,99}) == 110); assert(solutions({31,42,53,75,86,97,119,75}) == 203); assert(solutions({2,3,4,5,6,7,8,9,5}) == 5); assert(solutions({31,42,53,64,76,75,86,97,108,119}) == 84); assert(solutions({1,1,2,1,1,1,1,1,1}) == 4); assert(solutions({2,3,4,6,9,8,11,10,11}) == 31); assert(solutions({31,42,53,75,86,97,120,75}) == 84); assert(solutions({1,2,1,1,1,1,1,1,1}) == 5); assert(solutions({1,2,1,1,1,1,1}) == 4); assert(solutions({2,3,5,6,6,44,8,8,5}) == 10); assert(solutions({1,2,1,1,1,1,1,1,1,1}) == 5); assert(solutions({31,42,53,75,97,120,75}) == 256); assert(solutions({1,1,1,1,1,1,2,1,1,1}) == 4); assert(solutions({1,1,1,2,1,0,1,1,1,1}) == 5); assert(solutions({31,42,53,75,86,97,120,75,75}) == 159); assert(solutions({1,2,1,2,1,0,1,1,1,1,1}) == 6); assert(solutions({1,2,1,1,1,1,1,1,1,9,1}) == 6); assert(solutions({0,1,2,3,4,5,6,7,8,1,2}) == 0); assert(solutions({31,42,3,64,75,86,97,108,119}) == 325); assert(solutions({1,1,1,1,1,2,2,1,1,1,2}) == 4); assert(solutions({1,2,1,1,1,99,1,1,1,1,1}) == 6); assert(solutions({0,1,44,3,4,5,6,7,43,8}) == 43); assert(solutions({31,42,53,86,97,118,75}) == 256); assert(solutions({31,42,53,75,86,97,52,119,75}) == 159); assert(solutions({31,42,53,87,97,118,75}) == 256); assert(solutions({31,42,53,75,86,97,52,119,75,75}) == 159); assert(solutions({0,1,44,3,4,5,6,7,43}) == 43); assert(solutions({31,42,53,64,76,75,86,97,7,108,119}) == 210); assert(solutions({31,42,53,86,97,118}) == 181); assert(solutions({1,2,1,1,1,99,1,1,1,0}) == 5); assert(solutions({100,1,2,1,1,1,99,1,1,1,0}) == 101); assert(solutions({31,42,53,87,97,118}) == 181); assert(solutions({2,3,5,6,6,44,8,5}) == 5); assert(solutions({2,3,4,5,6,9,8,11,10,11}) == 0); assert(solutions({31,120,42,53,75,86,97,52,119,75,75}) == 397); assert(solutions({100,52,1,2,1,1,1,99,1,1,1,0}) == 5); assert(solutions({100,52,1,2,1,1,1,99,1,1,1,0,1}) == 6); assert(solutions({3,3,5,6,6,44,8,8,5}) == 13); assert(solutions({31,120,42,53,75,86,97,52,119,75,75,75}) == 397); assert(solutions({0,1,2,3,4,5,6,7,42,1,2}) == 0); assert(solutions({31,120,42,55,53,75,86,97,52,119,75,75}) == 159); assert(solutions({31,42,53,75,86,97,120,76,75,120}) == 159); assert(solutions({31,42,42,53,75,86,97,120,75}) == 278); assert(solutions({31,42,3,64,87,75,86,97,108,119}) == 121); assert(solutions({100,1,2,1,1,1,99,1,1,1,0,88}) == 101); assert(solutions({1,2,1,1,1,99,1,66,1,0}) == 5); assert(solutions({31,120,42,53,75,86,97,52,119,75,75,120,53}) == 450); assert(solutions({1,1,1,2,1,0,1,1,1}) == 5); assert(solutions({31,42,53,75,86,96,120,76,75,120,75}) == 234); assert(solutions({100,1,2,2,1,1,1,99,1,1,1,0,88}) == 4); assert(solutions({100,52,1,2,1,1,1,99,100,1,1,0,1}) == 5); assert(solutions({0,1,3,4,5,6,7,43,8}) == 15); assert(solutions({1,31,2,1,1,1,99,1,1,1,1,1}) == 103); assert(solutions({1,1,1,2,1,1,1,1,1,1}) == 5); assert(solutions({0,1,2,3,4,5,6,7,8,1,2,2}) == 0); assert(solutions({31,4,42,42,53,75,97,120,75}) == 256); assert(solutions({1,2,1,2,1,0,1,1,1,1,1,1}) == 6); assert(solutions({100,2,3,5,6,6,44,8,8,5}) == 3); assert(solutions({1,2,1,89,1,99,1,1,1,1,1}) == 6); assert(solutions({31,75,42,53,87,97,118,75}) == 118); assert(solutions({31,42,75,86,32,97,120,76,75,120}) == 181); assert(solutions({4,2,3,4,6,7,8,9,5}) == 8); assert(solutions({31,42,3,64,75,86,97,108,119,97}) == 325); assert(solutions({31,43,53,75,97,120,75}) == 256); assert(solutions({31,42,53,75,97,120,75,75}) == 256); assert(solutions({3,3,5,6,6,44,8,5}) == 8); assert(solutions({31,42,87,53,75,86,97,120,75,75}) == 365); assert(solutions({1,2,1,1,1,88,1,1,1}) == 5); assert(solutions({1,2,1,1,1,1,1,1,1,44,1}) == 6); assert(solutions({31,42,53,64,75,86,97,108,119,53}) == 375); assert(solutions({0,1,2,2,3,4,5,6,7,8,1,2}) == 16); assert(solutions({31,96,3,120,42,53,75,86,97,52,119,75,75,75}) == 400); assert(solutions({0,0,0,0,0,75}) == 0); assert(solutions({2,4,3,4,5,7,8,9,10}) == 8); assert(solutions({2,3,4,5,6,7,7,9,5}) == 12); assert(solutions({31,42,53,75,86,97,75}) == 159); assert(solutions({31,42,42,53,75,86,97,120,75,42}) == 278); assert(solutions({0,1,118,2,3,4,5,6,7,8}) == 15); assert(solutions({2,3,5,75,32,9,8,11,10,11}) == 5); assert(solutions({0,1,2,3,4,5,6,7,8,9,10,6}) == 0); assert(solutions({1,1,1,119,1,1,1,1,1,1}) == 5); assert(solutions({1,2,1,1,119,88,1,1}) == 122); assert(solutions({31,120,42,55,53,75,86,108,52,119,75,75}) == 159); assert(solutions({31,120,42,55,53,75,86,52,119,75,75}) == 278); assert(solutions({100,2,3,5,6,6,53,44,8,8,53,5,44,44}) == 109); assert(solutions({89,1,2,3,4,5,6,7}) == 89); assert(solutions({1,1,1,2,1,0,1,1,1,1,1}) == 6); assert(solutions({31,42,53,97,120,75,75}) == 159); assert(solutions({1,2,1,0,1,1,1,1}) == 4); assert(solutions({1,1,2,1,-1,1,1,1,1,1,1}) == 3); assert(solutions({31,42,42,53,75,86,97,97,119,75}) == 322); assert(solutions({0,0,0,0,-1,75}) == -1); assert(solutions({1,2,0,1,89,1,99,1,1,1,1,1,1}) == 192); assert(solutions({1,2,1,1,119,88,1,1,119}) == 241); assert(solutions({89,3,64,75,86,97,108,119,97}) == 186); assert(solutions({2,2,2,76,1,1,1,5,5,5,5}) == 12); assert(solutions({1,1,10,1,1,1,1,1,0}) == 3); assert(solutions({31,42,3,64,75,86,97,119,86}) == 206); assert(solutions({1,1,2,1,1,1,1,0,1}) == 4); assert(solutions({0,1,2,3,10,4,5,6,7,8,1,2,2}) == 13); assert(solutions({1,2,1,44,2,1,0,1,1,1,1,1}) == 4); assert(solutions({1,1,1,1,1,1,2,1,1,1,1,1}) == 5); assert(solutions({31,42,118,53,75,86,96,120,76,75,22,120,75,120}) == 181); assert(solutions({0,1,118,2,3,4,5,10,8}) == 8); assert(solutions({11,89,22,33,44,55,66,10,77,88,99,66}) == 187); assert(solutions({1,1,2,1,-1,1,6,1,1,1,1}) == 2); assert(solutions({0,1,118,2,3,4,5,10,8,1}) == 8); assert(solutions({30,31,54,42,53,86,97,118,75,97}) == 225); assert(solutions({2,3,4,5,6,9,8,11,10,8}) == 0); assert(solutions({31,42,53,75,86,43,97,120,75}) == 256); assert(solutions({1,2,1,1,119,2,88,1,1}) == 122); assert(solutions({1,2,1,2,1,1,1,1,1,9,1}) == 6); assert(solutions({31,42,42,53,75,86,98,120,75,42}) == 181); assert(solutions({0,1,2,3,4,5,7,7,8,9,10}) == 7); assert(solutions({1,2,1,89,1,99,1,1,1,1,1,1}) == 6); assert(solutions({89,1,2,3,4,6,7}) == 96); assert(solutions({31,120,42,53,75,86,97,52,89,119,75,75}) == 367); assert(solutions({0,1,2,3,4,5,6,7,8,1,2,0}) == 0); assert(solutions({11,32,89,22,33,44,55,66,77,77,88,99,11}) == 276); assert(solutions({86,42,3,64,75,86,97,108,66,97}) == 175); assert(solutions({0,1,3,4,5,7,7,43,8}) == 15); assert(solutions({31,4,42,42,53,75,97,120,75,75}) == 256); assert(solutions({1,1,2,1,0,1,0}) == 1); assert(solutions({1,1,96,55,1,1,1,1,2,1,1,1,1,1}) == 5); assert(solutions({1,1,10,1,1,1,1,1,0,1}) == 3); assert(solutions({1,1,2,1,0,1,1,1,0,1,1}) == 3); assert(solutions({31,4,42,42,22,53,75,97,120,75,22,22}) == 106); assert(solutions({31,42,3,64,87,75,86,97,108,119,31}) == 152); assert(solutions({0,1,2,3,5,6,7}) == 12); assert(solutions({1,1,1,2,1,0,22,1,1,1,1}) == 5); assert(solutions({0,1,2,3,4,5,6,10,42,1,2}) == 0); assert(solutions({1,1,2,1,0,1,89,1,1,0,1,1}) == 92); assert(solutions({1,2,1,1,120,119,88,1,1,119}) == 3); assert(solutions({1,1,119,88,1,1}) == 121); assert(solutions({31,43,7,53,75,86,97,120,75,75}) == 285); assert(solutions({100,52,1,2,1,1,1,99,1,1,1,0,1,1}) == 6); assert(solutions({31,75,10,53,87,97,118,75}) == 118); assert(solutions({89,1,2,4,5,6,7}) == 101); assert(solutions({31,42,3,64,87,75,97,108,119}) == 337); assert(solutions({1,2,1,44,2,1,0,1,1,1,1,1,1}) == 5); assert(solutions({1,2,1,1,120,119,1,1,119}) == 122); assert(solutions({31,42,53,75,86,97,120,76,75,119}) == 159); assert(solutions({3,3,5,6,7,44,8,5}) == 15); assert(solutions({1,2,1,0,1,1,1,1,1}) == 5); assert(solutions({86,2,1,1,1,1,1,1,66,1,44,1,1}) == 4); assert(solutions({0,0,0,0,0,32,0}) == 0); assert(solutions({31,120,2,42,55,54,53,75,86,52,119,75,75}) == 333); assert(solutions({31,42,53,75,86,97,76,75,120}) == 84); assert(solutions({1,1,1,1,1,2,2,75,1,1,2}) == 4); assert(solutions({2,31,42,53,75,86,97}) == 172); assert(solutions({31,4,42,42,22,53,75,97,120,75,22,22,31}) == 137); assert(solutions({30,2,4,6,7}) == 7); assert(solutions({65,89,3,64,75,86,97,108,119,98,97,75}) == 456); assert(solutions({2,44,4,3,4,5,7,8,9,10}) == 16); assert(solutions({1,2,1,1,120,119,1,1,119,1}) == 122); assert(solutions({100,1,2,2,1,1,1,99,1,1,1,0}) == 4); assert(solutions({76,31,42,53,75,86,97,120,76,75,120}) == 172); assert(solutions({31,42,53,86,97,87,118}) == 181); assert(solutions({89,2,3,4,5,6,7}) == 104); assert(solutions({86,2,1,1,1,1,1,1,4,1,44,1,1}) == 4); assert(solutions({1,43,1,44,2,1,0,1,1,1,1,1,1}) == 5); assert(solutions({31,64,42,43,53,75,97,120,75}) == 256); assert(solutions({2,2,2,1,1,0,5,5}) == 6); assert(solutions({3,3,5,6,6,44,8,8,5,3}) == 13); assert(solutions({1,99,31,2,1,1,1,99,1,1,108,1,1}) == 36); assert(solutions({89,3,33,64,75,86,97,108,119,97,75}) == 488); assert(solutions({31,120,42,55,53,75,86,108,52,119,75,108,42,75}) == 159); assert(solutions({1,1,1,119,0,1,1,1,1,1,1}) == 5); assert(solutions({30,42,3,64,87,75,86,97,108,119}) == 90); assert(solutions({0,1,2,3,10,4,5,7,8,1,2,2}) == 5); assert(solutions({31,42,53,64,76,75,86,97,7,108,119,75}) == 210); assert(solutions({31,42,53,75,86,97,76,75,120,31}) == 84); assert(solutions({1,31,2,1,1,1,99,1,1,1,1,119}) == 103); assert(solutions({100,2,3,5,6,6,53,44,8,53,5,44,44}) == 61); assert(solutions({0,7,1,2,4,5,6,7,8,1,2,0}) == 1); assert(solutions({2,2,2,1,1,1,77,5,5,5}) == 83); assert(solutions({31,42,53,53,87,97,118,53}) == 171); assert(solutions({89,1,1,3,4,5,6,7}) == 90); assert(solutions({76,89,31,42,53,30,75,86,97,120,76,75,120,97}) == 256); assert(solutions({31,53,64,76,75,86,97,7,107,119,75,75}) == 385); assert(solutions({1,1,1,120,119,1,1,119}) == 122); assert(solutions({0,1,118,2,3,4,5,6,7,8,7}) == 22); assert(solutions({31,42,55,75,86,97,77,120,42}) == 163); assert(solutions({86,42,118,53,75,86,96,120,76,75,22,120,75,120}) == 150); assert(solutions({31,76,42,55,75,86,97,77,120,42,86}) == 203); assert(solutions({100,1,2,2,1,1,1,99,1,1,1,0,88,1}) == 4); assert(solutions({1,1,119,88,1,0,1}) == 122); assert(solutions({1,2,0,1,89,1,99,1,2,1,1,1,1}) == 191); assert(solutions({31,43,7,53,75,75,86,6,120,75,75}) == 188); assert(solutions({31,75,10,53,87,97,118,75,31}) == 149); assert(solutions({0,1,2,3,4,5,6,31,7,8,1,2,2}) == 8); assert(solutions({2,3,65,4,6,7,7,9,5}) == 77); assert(solutions({77,52,1,2,1,1,1,99,33,1,1,1,0,1}) == 114); assert(solutions({11,1,2,1,1,1,99,1,1,1,0}) == 112); assert(solutions({42,53,75,86,97,76,75,120}) == 247); assert(solutions({3,3,6,44,8,22,5,3}) == 8); assert(solutions({89,1,1,3,4,5,6,7,1,7}) == 91); assert(solutions({42,96,53,97,120,75,75,120}) == 128); assert(solutions({31,120,42,53,75,86,97,76,75,75}) == 278); assert(solutions({1,2,1,1,1,1}) == 3); assert(solutions({1,1,2,1,-1,1,6,1,1,1,1,2}) == 2); assert(solutions({100,1,2,2,1,1,1,99,1,1,1,0,88,1,2}) == 4); assert(solutions({31,66,120,42,55,53,75,86,108,52,119,75,108,42,75}) == 355); assert(solutions({1,119,88,1,1}) == 2); assert(solutions({1,1,2,1,1,1,1,1,1,1}) == 4); assert(solutions({2,2,2,1,1,1,5,1}) == 6); assert(solutions({1,1,1,119,1,1,1,1,1,1,1}) == 6); assert(solutions({1,2,1,1,119,88,1,1,119,1}) == 241); assert(solutions({31,42,3,87,31,86,97,108,119}) == 281); assert(solutions({1,1,96,55,1,1,1,22,2,1,1,1,1,1,55}) == 60); assert(solutions({31,42,75,86,32,97,120,76,99,120}) == 205); assert(solutions({31,42,3,64,87,75,86,97,119}) == 240); assert(solutions({1,2,0,1,89,1,99,1,2,1,1,1,1,98}) == 191); assert(solutions({1,1,1,119,2,1,119}) == 121); assert(solutions({119,31,42,53,64,75,86,97,108,1,119}) == 238); assert(solutions({11,32,89,22,33,44,55,66,77,77,88,11}) == 265); assert(solutions({97,52,1,2,1,0,1,0}) == 100); assert(solutions({2,4,3,4,5,7,8,9}) == 8); assert(solutions({1,1,1,120,119,1,1,119,1}) == 123); assert(solutions({1,2,1,0,1,1,1,1,1,1}) == 5); assert(solutions({2,2,2,1,1,5,5,5}) == 6); assert(solutions({1,2,9,2,1,0,1,1,1,1,1,1}) == 14); assert(solutions({0,0,0,0,0,32,-1,0}) == -1); assert(solutions({2,42,2,1,1,0,5,5}) == 6); assert(solutions({0,1,2,1,-1,1,1,1,1,1,1,1}) == 2); assert(solutions({1,31,2,1,1,1,99,1,1,1,1,53,1}) == 104); assert(solutions({2,31,42,22,53,75,86,97}) == 53); assert(solutions({11,31,2,1,1,1,99,1,1,1,1,53,1}) == 114); assert(solutions({42,53,75,86,119,97,76,75,120,120}) == 194); assert(solutions({0,4,1,118,2,3,4,5,10,8}) == 1); assert(solutions({89,1,2,3,4,6,7,4}) == 96); assert(solutions({2,42,42,1,1,0,5,5}) == 6); assert(solutions({31,42,5,97,120,75,75,97}) == 111); assert(solutions({31,41,3,87,31,86,97,108,119}) == 281); assert(solutions({100,1,2,1,1,1,1,0}) == 2); assert(solutions({100,1,2,1,1,1,99,1,1,1,0,88,1}) == 102); assert(solutions({0,1,118,2,3,4,5,6,7,8,8,118,1}) == 16); assert(solutions({31,42,42,53,75,86,97,97,119,75,97}) == 419); assert(solutions({22,42,53,75,86,97,120,75}) == 53); assert(solutions({1,2,1,1,120,64,88,1,1,119}) == 3); assert(solutions({1,2,42,1,89,66,99,1,1,1,1,1,1}) == 192); assert(solutions({2,1,1,88,1,1,1}) == 3); assert(solutions({100,2,3,5,6,6,44,8,75,5}) == 78); assert(solutions({100,1,2,1,1,1,99,1,1,1,0,88,99}) == 200); assert(solutions({0,1,2,3,4,5,6,7,8,9,9,6}) == 9); assert(solutions({89,1,2,3,4,5,7}) == 96); assert(solutions({1,1,96,55,1,1,1,22,2,1,1,1,1,1,55,2}) == 60); assert(solutions({1,1,2,1,86,1,1,0,77,1,1}) == 80); assert(solutions({42,53,75,86,97,120,75,75}) == 247); assert(solutions({1,1,96,55,1,0,1,22,2,1,1,1,1,1,55,2}) == 60); assert(solutions({4,41,2,3,4,6,7,8,9,5}) == 16); assert(solutions({30,31,54,42,53,86,97,118,75,97,118}) == 225); assert(solutions({0,1,44,3,4,5,6,7,66,3}) == 0); assert(solutions({1,1,1,1,2,2,75,0,1,2}) == 78); assert(solutions({42,3,64,75,86,97,119,86}) == 119); assert(solutions({76,31,42,53,75,53,97,120,76,75,120}) == 172); assert(solutions({31,4,42,42,53,75,5,97,120,75,75}) == 164); assert(solutions({31,75,10,52,87,97,118,3,75}) == 193); assert(solutions({3,3,5,6,6,44,8,88,5}) == 13); assert(solutions({1,2,1,44,2,1,0,1,1,1,2,1}) == 3); assert(solutions({0,1,2,3,4,5,6,1,10,42,1,2}) == 1); assert(solutions({30,31,54,42,53,86,97,118,97}) == 247); assert(solutions({30,31,54,42,53,86,97,118,75,118}) == 225); assert(solutions({31,42,32,75,86,32,97,120,76,75,120,42,76}) == 128); assert(solutions({1,1,1,1,2,1,0,1,1,1,1,1}) == 4); assert(solutions({31,120,42,55,53,75,86,52,22,30,75,75}) == 159); assert(solutions({1,1,2,1,-1,1,6,1,1,1}) == 1); assert(solutions({11,89,22,33,44,66,88,99}) == 11); assert(solutions({31,42,87,22,53,75,86,97}) == 171); assert(solutions({42,53,75,86,119,97,76,75,120}) == 194); assert(solutions({31,42,53,86,97,87,118,42}) == 181); assert(solutions({31,120,42,55,53,75,86,52,22,30,75,87,75}) == 234); assert(solutions({31,120,42,41,53,75,86,97,52,119,75,75,75}) == 234); assert(solutions({0,1,118,2,117,3,4,5,10,8,1}) == 118); assert(solutions({1,2,1,2,1,1,119,1,1,1,1,1}) == 124); assert(solutions({0,1,4,5,7,7,43,8,8}) == 50); assert(solutions({1,1,10,1,2,1,1,1,1}) == 3); assert(solutions({1,2,1,44,2,1,0,1,1,1,2,1,0}) == 3); assert(solutions({11,1,2,1,1,1,99,1,1,1,0,2}) == 112); assert(solutions({31,42,42,53,75,86,97,97,119,75,97,53}) == 419); assert(solutions({31,42,53,75,86,97,52,119,75,75,75}) == 234); assert(solutions({31,42,3,64,88,75,97,108,119}) == 250); assert(solutions({0,43,0,0,0,43,0,75}) == 0); assert(solutions({89,1,2,4,4,6,7,1}) == 96); assert(solutions({2,4,3,44,4,5,7,8,8}) == 10); assert(solutions({31,4,41,42,22,53,75,97,120,75,22}) == 147); assert(solutions({1,2,1,-1,1,6,1,1,1}) == 5); assert(solutions({1,1,2,1,0,1,0,1}) == 1); assert(solutions({1,2,1,89,1,2,98,1,1,1,1,1,1}) == 6); assert(solutions({1,31,2,1,1,1,99,1,1,41,1,1,53,1,2}) == 156); assert(solutions({0,1,8,3,4,5,6,7,43}) == 43); assert(solutions({0,7,1,2,4,5,86,7,8,1,2,0}) == 1); assert(solutions({0,1,2,2,4,5,6,7,8,1,2,0}) == 0); assert(solutions({30,42,5,97,120,75,75,97}) == 80); assert(solutions({30,31,54,42,53,97,118,97}) == 53); assert(solutions({1,1,2,1,1,0}) == 2); assert(solutions({31,120,42,55,53,75,86,52,23,30,75,75,75}) == 257); assert(solutions({1,1,1,2,1,-1,1,6,1,1,1,1,2,2}) == 6); assert(solutions({31,42,53,75,86,97,52,119}) == 84); assert(solutions({1,1,2,1,-1,1,1,1,1,1,1,1}) == 3); assert(solutions({65,89,3,64,75,86,97,108,119,98,97,75,3,3}) == 459); assert(solutions({1,2,1,1,1,1,1,1,1,44,1,1}) == 6); assert(solutions({31,42,87,53,75,86,97,120,75,53}) == 365); assert(solutions({1,1,1,120,119,119,1,1,119,1}) == 241); assert(solutions({1,2,1,44,2,1,0,119,1,1,9,1,1}) == 13); assert(solutions({0,1,2,2,4,5,31,7,8,1,2,0}) == 31); assert(solutions({30,65,31,54,42,53,86,97,118,75,97}) == 128); assert(solutions({1,2,1,1,0,99,1,1,1,0}) == 4); assert(solutions({1,1,119,44,1,1}) == 121); assert(solutions({42,96,97,120,75,75,120}) == 172); assert(solutions({2,3,4,5,6,9,8,11,10,8,6}) == 0); assert(solutions({1,2,42,1,100,89,66,99,1,1,1,1,1,1,1,99}) == 5); assert(solutions({1,1,96,55,1,0,1,22,2,1,1,1,1,1,55,2,1}) == 61); assert(solutions({31,120,42,41,53,75,86,97,52,119,75,75,51,75}) == 210); assert(solutions({1,30,1,2,1,0,22,76,1,1,1,1}) == 5); assert(solutions({0,2,3,4,6,7,8,9,10}) == 3); assert(solutions({1,31,2,1,1,1,99,1,1,1,1,119,1}) == 104); assert(solutions({3,2,2,2,1,1,1,5,1}) == 6); assert(solutions({76,89,31,42,53,30,75,86,97,120,76,75,120,97,120}) == 256); assert(solutions({75,120,42,53,75,86,97,52,119,75,75,75}) == 441); assert(solutions({100,1,2,1,1,99,1,1,1,0,88,99,1}) == 4); assert(solutions({1,1,2,1,-1,1,1,1,1,1,1,1,1}) == 4); assert(solutions({2,42,2,1,1,0,5}) == 6); assert(solutions({2,2,1,1,1,5,2,5}) == 2); assert(solutions({1,1,1,120,119,119,1,2,1,119,1}) == 124); assert(solutions({31,42,53,64,76,75,86,97,7,108,118,119}) == 91); assert(solutions({86,42,118,53,75,86,96,31,76,75,22,120,75,120}) == 150); assert(solutions({30,2,4,6,7,4}) == 7); assert(solutions({120,31,42,53,87,97,118,87}) == 87); assert(solutions({31,120,42,55,53,75,86,52,52,30,75,87,75,87}) == 234); assert(solutions({30,65,31,54,64,42,53,86,97,118,75,97,75}) == 331); assert(solutions({1,1,1,1,1,2,2,75,1,1,2,76,1}) == 5); assert(solutions({31,42,66,53,10,87,97,118,53}) == 181); assert(solutions({1,0,2,1,1,1,99,1,1,1,0}) == 102); assert(solutions({42,3,64,87,75,86,97,108}) == 172); assert(solutions({2,2,2,1,0,1,5,5}) == 5); assert(solutions({1,1,2,1,1,1,1,0,1,1,1}) == 5); assert(solutions({41,1,3,4,5,7,7,43,8}) == 56); assert(solutions({1,31,2,5,1,1,99,1,1,1,1,119,1}) == 104); assert(solutions({1,2,1,1,120,119,1,1,89,1}) == 92); assert(solutions({1,1,1,44,120,119,1,1,119,1}) == 122); assert(solutions({1,2,1,22,2,1,0,119,1,1,9,1,1}) == 13); assert(solutions({31,42,5,97,120,75,75,88}) == 111); assert(solutions({31,42,3,64,88,75,97,108,31}) == 162); assert(solutions({89,2,3,119,1,5,6,7}) == 93); assert(solutions({1,1,1,1,2,2,74,75,0,1,2}) == 2); assert(solutions({118,96,53,97,120,75,75,120}) == 128); assert(solutions({1,1,2,1,-1,1,6,1,66,1,1,1}) == 1); assert(solutions({42,53,86,119,97,76,75,120}) == 172); assert(solutions({1,1,2,1,86,1,1,0,77,1,1,86}) == 80); assert(solutions({0,1,44,4,5,6,7,66,3}) == 15); assert(solutions({1,2,1,43,1,1,88,1,1,1,1}) == 5); assert(solutions({31,120,42,41,53,75,86,97,52,119,75,75,75,53}) == 234); assert(solutions({31,120,42,53,75,86,97,52,89,119,90,75,75}) == 367); assert(solutions({31,4,42,42,53,75,97,120,75,75,53}) == 309); assert(solutions({30,42,3,64,87,75,86,97,119}) == 209); assert(solutions({1,2,42,1,6,66,99,1,1,1,1,1,1}) == 103); assert(solutions({1,2,1,1,120,76,119,1,1,119,1}) == 123); assert(solutions({0,1,2,2,3,4,5,6,7,31,8,1,2,8}) == 15); assert(solutions({89,4,5,6,7,6}) == 101); assert(solutions({89,3,52,64,75,86,97,108,119,97,75,89}) == 455); assert(solutions({30,31,54,42,53,86,97,118,75,97,118,54}) == 225); assert(solutions({100,1,2,1,1,1,1,0,0}) == 2); assert(solutions({100,52,1,2,1,1,1,99,1,2,1,1,0,1}) == 5); assert(solutions({100,52,1,2,1,1,1,31,99,1,1,1,0,1}) == 103); assert(solutions({1,1,1,2,1,1,1,1,1,1,1}) == 6); assert(solutions({31,42,3,64,87,75,64,86,97,108,119,31}) == 337); assert(solutions({1,2,1,1,1,88,1,1,1,1}) == 5); assert(solutions({1,1,2,1,0,1,0,97}) == 1); assert(solutions({30,42,3,64,87,2,75,86,97,119,3}) == 265); assert(solutions({1,2,1,89,1,99,10,1,1,1,1,1}) == 5); assert(solutions({31,120,2,42,55,54,53,75,119,75,75,120}) == 333); assert(solutions({1,1,119,0,1,1,1,1,1,1}) == 123); assert(solutions({4,3,4,5,7,8,9}) == 16); assert(solutions({31,120,42,75,120,41,53,75,86,97,52,119,75,75,75,53}) == 234); assert(solutions({1,2,1,43,1,1,88,1,1,1}) == 4); assert(solutions({31,42,53,75,86,97,52,75,53}) == 137); assert(solutions({4,41,2,3,4,6,7,8,9,5,9}) == 25); assert(solutions({1,119,88,1,1,1}) == 2); assert(solutions({31,120,76,42,41,53,75,86,97,52,119,75,75,51,75}) == 513); assert(solutions({30,42,3,64,87,75,86,108,119}) == 209); assert(solutions({86,2,2,1,1,1,1,1,1,4,107,44,1,1}) == 111); }
starts_one_ends
/* Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. */ #include<stdio.h> using namespace std; int starts_one_ends(int n){ if (n<1) return 0; if (n==1) return 1; int out=19; for (int i=2;i<n;i++) out=out*10; return out; }
/* Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. */ #include<stdio.h> using namespace std; int starts_one_ends(int n){ if (n<1) return 0; if (n==1) return 1; int out=18; for (int i=2;i<n;i++) out=out*10; return out; }
/* Given a positive integer n, return the count of the numbers of n-digit positive integers that start or end with 1. */ #include<stdio.h> using namespace std; int starts_one_ends(int n){
#undef NDEBUG #include<assert.h> int main(){ assert (starts_one_ends(1) == 1); assert (starts_one_ends(2) == 18); assert (starts_one_ends(3) == 180); assert (starts_one_ends(4) == 1800); assert (starts_one_ends(5) == 18000); assert(starts_one_ends(1) == 1); assert(starts_one_ends(2) == 18); assert(starts_one_ends(3) == 180); assert(starts_one_ends(4) == 1800); assert(starts_one_ends(5) == 18000); assert(starts_one_ends(6) == 180000); assert(starts_one_ends(10) == 1800000000); assert(starts_one_ends(8) == 18000000); assert(starts_one_ends(9) == 180000000); assert(starts_one_ends(7) == 1800000); }
is_prime
/* Return true if a given number is prime, and false otherwise. >>> is_prime(6) false >>> is_prime(101) true >>> is_prime(11) true >>> is_prime(13441) true >>> is_prime(61) true >>> is_prime(4) false >>> is_prime(1) false */ #include<stdio.h> using namespace std; bool is_prime(long long n){ if (n<2) return false; for (long long i=2;i*i<n;i++) if (n%i==0) return false; return true; }
/* Return true if a given number is prime, and false otherwise. >>> is_prime(6) false >>> is_prime(101) true >>> is_prime(11) true >>> is_prime(13441) true >>> is_prime(61) true >>> is_prime(4) false >>> is_prime(1) false */ #include<stdio.h> using namespace std; bool is_prime(long long n){ if (n<2) return false; for (long long i=2;i*i<=n;i++) if (n%i==0) return false; return true; }
/* Return true if a given number is prime, and false otherwise. >>> is_prime(6) false >>> is_prime(101) true >>> is_prime(11) true >>> is_prime(13441) true >>> is_prime(61) true >>> is_prime(4) false >>> is_prime(1) false */ #include<stdio.h> using namespace std; bool is_prime(long long n){
#undef NDEBUG #include<assert.h> int main(){ assert (is_prime(6) == false); assert (is_prime(101) == true); assert (is_prime(11) == true); assert (is_prime(13441) == true); assert (is_prime(61) == true); assert (is_prime(4) == false); assert (is_prime(1) == false); assert (is_prime(5) == true); assert (is_prime(11) == true); assert (is_prime(17) == true); assert (is_prime(5 * 17) == false); assert (is_prime(11 * 7) == false); assert (is_prime(13441 * 19) == false); assert(is_prime(6) == false); assert(is_prime(101) == true); assert(is_prime(11) == true); assert(is_prime(13441) == true); assert(is_prime(61) == true); assert(is_prime(4) == false); assert(is_prime(1) == false); assert(is_prime(5) == true); assert(is_prime(17) == true); assert(is_prime(85) == false); assert(is_prime(77) == false); assert(is_prime(255379) == false); assert(is_prime(-5) == false); assert(is_prime(0) == false); assert(is_prime(2) == true); assert(is_prime(31) == true); assert(is_prime(40) == false); assert(is_prime(103) == true); assert(is_prime(199) == true); assert(is_prime(1009) == true); assert(is_prime(8999) == true); assert(is_prime(1234567) == false); assert(is_prime(9000) == false); assert(is_prime(32) == false); assert(is_prime(9001) == true); assert(is_prime(-1) == false); assert(is_prime(39) == false); assert(is_prime(1234566) == false); assert(is_prime(-4) == false); assert(is_prime(9002) == false); assert(is_prime(-6) == false); assert(is_prime(102) == false); assert(is_prime(200) == false); assert(is_prime(56) == false); assert(is_prime(38) == false); assert(is_prime(37) == true); assert(is_prime(1010) == false); assert(is_prime(1234568) == false); assert(is_prime(1008) == false); assert(is_prime(33) == false); assert(is_prime(35) == false); assert(is_prime(64) == false); assert(is_prime(63) == false); assert(is_prime(1234564) == false); assert(is_prime(34) == false); assert(is_prime(1011) == false); assert(is_prime(1234569) == false); assert(is_prime(197) == true); assert(is_prime(-3) == false); assert(is_prime(8998) == false); assert(is_prime(57) == false); assert(is_prime(28) == false); assert(is_prime(-2) == false); assert(is_prime(3) == true); assert(is_prime(1234563) == false); assert(is_prime(36) == false); assert(is_prime(9003) == false); assert(is_prime(30) == false); assert(is_prime(1234570) == false); assert(is_prime(-29) == false); assert(is_prime(9004) == false); assert(is_prime(-7) == false); assert(is_prime(16) == false); assert(is_prime(1012) == false); assert(is_prime(55) == false); assert(is_prime(-30) == false); assert(is_prime(-17) == false); assert(is_prime(7937) == true); assert(is_prime(34981) == true); assert(is_prime(42043) == true); assert(is_prime(-10) == false); assert(is_prime(123456789) == false); assert(is_prime(-9) == false); assert(is_prime(-18) == false); assert(is_prime(42042) == false); assert(is_prime(12) == false); assert(is_prime(123456790) == false); assert(is_prime(-16) == false); assert(is_prime(-15) == false); assert(is_prime(7939) == false); assert(is_prime(7938) == false); assert(is_prime(7936) == false); assert(is_prime(13) == true); assert(is_prime(7935) == false); assert(is_prime(23) == true); assert(is_prime(42044) == false); assert(is_prime(-11) == false); assert(is_prime(-14) == false); assert(is_prime(7934) == false); assert(is_prime(7933) == true); assert(is_prime(14) == false); assert(is_prime(34980) == false); assert(is_prime(24) == false); assert(is_prime(15) == false); assert(is_prime(42041) == false); assert(is_prime(-8) == false); assert(is_prime(7940) == false); assert(is_prime(70) == false); assert(is_prime(-13) == false); assert(is_prime(-40) == false); assert(is_prime(18) == false); assert(is_prime(-12) == false); assert(is_prime(-47) == false); assert(is_prime(-49) == false); assert(is_prime(34979) == false); assert(is_prime(42040) == false); assert(is_prime(34978) == false); assert(is_prime(-41) == false); assert(is_prime(-42) == false); assert(is_prime(22) == false); assert(is_prime(25) == false); assert(is_prime(10) == false); assert(is_prime(67) == true); assert(is_prime(-39) == false); assert(is_prime(26) == false); assert(is_prime(62) == false); assert(is_prime(-48) == false); assert(is_prime(66) == false); assert(is_prime(-20) == false); assert(is_prime(7941) == false); assert(is_prime(-50) == false); assert(is_prime(-37) == false); assert(is_prime(-21) == false); assert(is_prime(-28) == false); assert(is_prime(-101) == false); assert(is_prime(-255379) == false); assert(is_prime(-2147483648) == false); assert(is_prime(9999991) == true); assert(is_prime(34982) == false); assert(is_prime(34977) == false); assert(is_prime(123456788) == false); assert(is_prime(123456791) == true); assert(is_prime(-91) == false); assert(is_prime(93) == false); assert(is_prime(-90) == false); assert(is_prime(92) == false); assert(is_prime(34983) == false); assert(is_prime(-92) == false); assert(is_prime(-89) == false); assert(is_prime(-78) == false); assert(is_prime(82) == false); assert(is_prime(-76) == false); assert(is_prime(45) == false); assert(is_prime(42045) == false); assert(is_prime(44) == false); assert(is_prime(46) == false); assert(is_prime(-100) == false); assert(is_prime(19) == true); assert(is_prime(72) == false); assert(is_prime(91) == false); assert(is_prime(-38) == false); assert(is_prime(-75) == false); }
digits
/* Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. For example: digits(1) == 1 digits(4) == 0 digits(235) == 15 */ #include<stdio.h> #include<string> using namespace std; int digits(int n){ int prod=1,has=0; string s=to_string(n); for (int i=0;i<s.length();i++) if (s[i]%2==0) { has=1; prod=prod*(s[i]-48); } if (has==0) return 0; return prod; }
/* Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. For example: digits(1) == 1 digits(4) == 0 digits(235) == 15 */ #include<stdio.h> #include<string> using namespace std; int digits(int n){ int prod=1,has=0; string s=to_string(n); for (int i=0;i<s.length();i++) if (s[i]%2==1) { has=1; prod=prod*(s[i]-48); } if (has==0) return 0; return prod; }
/* Given a positive integer n, return the product of the odd digits. Return 0 if all digits are even. For example: digits(1) == 1 digits(4) == 0 digits(235) == 15 */ #include<stdio.h> #include<string> using namespace std; int digits(int n){
#undef NDEBUG #include<assert.h> int main(){ assert (digits(5) == 5); assert (digits(54) == 5); assert (digits(120) ==1); assert (digits(5014) == 5); assert (digits(98765) == 315); assert (digits(5576543) == 2625); assert (digits(2468) == 0); assert (digits(5) == 5); assert (digits(54) == 5); assert (digits(120) == 1); assert (digits(5014) == 5); assert (digits(98765) == 315); assert (digits(5576543) == 2625); assert (digits(2468) == 0); assert (digits(951) == 45); assert (digits(246) == 0); assert (digits(135797531) == 99225); assert (digits(888) == 0); assert (digits(182135) == 15); assert (digits(703) == 21); assert (digits(999) == 729); assert (digits(111) == 1); assert (digits(1001) == 1); assert (digits(3) == 3); assert (digits(952) == 45); assert (digits(889) == 9); assert (digits(998) == 81); assert (digits(2) == 0); assert (digits(182136) == 3); assert (digits(25) == 5); assert (digits(701) == 7); assert (digits(4) == 0); assert (digits(24) == 0); assert (digits(997) == 567); assert (digits(247) == 7); assert (digits(6) == 0); assert (digits(953) == 135); assert (digits(135797532) == 99225); assert (digits(7) == 7); assert (digits(248) == 0); assert (digits(23) == 3); assert (digits(996) == 81); assert (digits(135797533) == 297675); assert (digits(995) == 405); assert (digits(994) == 81); assert (digits(891) == 9); assert (digits(26) == 0); assert (digits(8) == 0); assert (digits(112) == 1); assert (digits(22) == 0); assert (digits(950) == 45); assert (digits(702) == 7); assert (digits(1000) == 1); assert (digits(704) == 7); assert (digits(182137) == 21); assert (digits(893) == 27); assert (digits(993) == 243); assert (digits(135797534) == 99225); assert (digits(135797535) == 496125); assert (digits(245) == 5); assert (digits(249) == 9); assert (digits(9) == 9); assert (digits(244) == 0); assert (digits(890) == 9); assert (digits(47) == 7); assert (digits(992) == 81); assert (digits(700) == 7); assert (digits(135797530) == 99225); assert (digits(705) == 35); assert (digits(243) == 3); assert (digits(27) == 7); assert (digits(182134) == 3); assert (digits(887) == 7); assert (digits(46) == 0); assert (digits(894) == 9); assert (digits(699) == 81); assert (digits(45) == 5); assert (digits(707) == 49); assert (digits(892) == 9); assert (digits(182138) == 3); assert (digits(182139) == 27); assert (digits(1002) == 1); assert (digits(113) == 3); assert (digits(1) == 1); assert (digits(88) == 0); assert (digits(706) == 7); assert (digits(250) == 5); assert (digits(110) == 1); assert (digits(949) == 81); assert (digits(698) == 9); assert (digits(242) == 0); assert (digits(11) == 1); assert (digits(135797529) == 297675); assert (digits(1003) == 3); assert (digits(109) == 9); assert (digits(135797536) == 99225); assert (digits(182133) == 9); assert (digits(43) == 3); assert (digits(135797538) == 99225); assert (digits(241) == 1); assert (digits(71) == 7); assert (digits(114) == 1); assert (digits(28) == 0); assert (digits(135797539) == 893025); assert (digits(10) == 1); assert (digits(89) == 9); assert (digits(954) == 45); assert (digits(240) == 0); assert (digits(44) == 0); assert (digits(886) == 0); assert (digits(115) == 5); assert (digits(70) == 7); assert (digits(991) == 81); assert (digits(13579) == 945); assert (digits(123456789) == 945); assert (digits(945) == 45); assert (digits(123456788) == 105); assert (digits(123456787) == 735); assert (digits(944) == 9); assert (digits(943) == 27); assert (digits(942) == 9); assert (digits(941) == 9); assert (digits(123456786) == 105); assert (digits(13578) == 105); assert (digits(53) == 15); assert (digits(940) == 9); assert (digits(52) == 5); assert (digits(946) == 9); assert (digits(73) == 21); assert (digits(947) == 63); assert (digits(55) == 25); assert (digits(16) == 1); assert (digits(69) == 9); assert (digits(15) == 5); assert (digits(13577) == 735); assert (digits(30) == 3); assert (digits(74) == 7); assert (digits(64) == 0); assert (digits(72) == 7); assert (digits(17) == 7); assert (digits(14) == 1); assert (digits(51) == 5); assert (digits(95) == 45); assert (digits(94) == 9); assert (digits(123456785) == 525); assert (digits(57) == 35); assert (digits(32) == 3); assert (digits(65) == 5); assert (digits(62) == 0); assert (digits(68) == 0); assert (digits(123456784) == 105); assert (digits(18) == 1); assert (digits(33) == 9); assert (digits(96) == 9); assert (digits(76) == 7); assert (digits(948) == 9); assert (digits(75) == 35); assert (digits(13580) == 15); assert (digits(13) == 3); assert (digits(123456783) == 315); assert (digits(100) == 1); assert (digits(13581) == 15); assert (digits(123456790) == 945); assert (digits(13576) == 105); assert (digits(13582) == 15); assert (digits(123456791) == 945); assert (digits(13583) == 45); assert (digits(21) == 1); assert (digits(49) == 9); assert (digits(20) == 0); assert (digits(13585) == 75); assert (digits(123456792) == 945); assert (digits(99) == 81); assert (digits(48) == 0); }
flip_case
/* For a given string, flip lowercase characters to uppercase and uppercase to lowercase. >>> flip_case("Hello") "hELLO" */ #include<stdio.h> #include<string> using namespace std; string flip_case(string str){ string out=""; for (int i=0;i<str.length();i++) { char w=str[i]; if (w>=97 and w<=122) {w+=32;} else if (w>=65 and w<=90){ w-=32;} out=out+w; } return out; }
/* For a given string, flip lowercase characters to uppercase and uppercase to lowercase. >>> flip_case("Hello") "hELLO" */ #include<stdio.h> #include<string> using namespace std; string flip_case(string str){ string out=""; for (int i=0;i<str.length();i++) { char w=str[i]; if (w>=97 and w<=122) {w-=32;} else if (w>=65 and w<=90){ w+=32;} out=out+w; } return out; }
/* For a given string, flip lowercase characters to uppercase and uppercase to lowercase. >>> flip_case("Hello") "hELLO" */ #include<stdio.h> #include<string> using namespace std; string flip_case(string str){
#undef NDEBUG #include<assert.h> int main(){ assert (flip_case("") == ""); assert (flip_case("Hello!") == "hELLO!"); assert (flip_case("These violent delights have violent ends") == "tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS"); assert (flip_case("") == ""); assert (flip_case("Hello!") == "hELLO!"); assert (flip_case("123abc") == "123ABC"); assert (flip_case("1234") == "1234"); assert (flip_case("Togg") == "tOGG"); assert (flip_case("Fun") == "fUN"); assert (flip_case("12134") == "12134"); assert (flip_case("nbfLDUjAi") == "NBFlduJaI"); assert (flip_case("112134") == "112134"); assert (flip_case("112111213434") == "112111213434"); assert (flip_case("1213112134abc") == "1213112134ABC"); assert (flip_case("gTogg") == "GtOGG"); assert (flip_case("JmWn") == "jMwN"); assert (flip_case("PtoFin") == "pTOfIN"); assert (flip_case("Fu123abcn") == "fU123ABCN"); assert (flip_case("gToggg") == "GtOGGG"); assert (flip_case("totggleme") == "TOTGGLEME"); assert (flip_case("ttotggl") == "TTOTGGL"); assert (flip_case("qJzU") == "QjZu"); assert (flip_case("ggleme") == "GGLEME"); assert (flip_case("1121PtoGGlE4") == "1121pTOggLe4"); assert (flip_case("AaBbccDEfFgHiIjJKkLMmnnoOPpqQrRSstTuUVvwWXxyYZz") == "aAbBCCdeFfGhIiJjkKlmMNNOopPQqRrsSTtUuvVWwxXYyzZ"); assert (flip_case("1234567890") == "1234567890"); assert (flip_case("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); assert (flip_case("Quick") == "qUICK"); assert (flip_case("1234656890") == "1234656890"); assert (flip_case("DOGe") == "dogE"); assert (flip_case("jUMPed") == "JumpED"); assert (flip_case("jUMePPed") == "JumEppED"); assert (flip_case("jUeMePP") == "JuEmEpp"); assert (flip_case("ABCDEFGHIJKLMNOPQRSTUVWtheXYZabcdefghijklmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwTHExyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); assert (flip_case("AaBbccDEfFgHiIjJKkLMmnnoOPtpqQrRSstTuUVvwWXxyYZz") == "aAbBCCdeFfGhIiJjkKlmMNNOopTPQqRrsSTtUuvVWwxXYyzZ"); assert (flip_case("AaBbccDEfFgHiIjJKkjUMPedLMmnnoOPtpqQrRSstTuUVvwWXxyYZz") == "aAbBCCdeFfGhIiJjkKJumpEDlmMNNOopTPQqRrsSTtUuvVWwxXYyzZ"); assert (flip_case("ABCDzEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrsz") == "abcdZefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSZ"); assert (flip_case("sKawvm") == "SkAWVM"); assert (flip_case("ABCDzEFGHIJKLMNOPQRklmnopqrsz") == "abcdZefghijklmnopqrKLMNOPQRSZ"); assert (flip_case("Brown") == "bROWN"); assert (flip_case("dotHe") == "DOThE"); assert (flip_case("KX") == "kx"); assert (flip_case("12340656890") == "12340656890"); assert (flip_case("ABCDzEFGHIJKOPQRSTUVWXYZabcdefghijklmnopqrsz") == "abcdZefghijkopqrstuvwxyzABCDEFGHIJKLMNOPQRSZ"); assert (flip_case("usted") == "USTED"); assert (flip_case("ULAZY") == "ulazy"); assert (flip_case("nl") == "NL"); assert (flip_case("ULAbROwnZY") == "ulaBroWNzy"); assert (flip_case("ABCDzEFGHIJKOPQRSTUVWXYZabcdqefghijklmnopqrsz") == "abcdZefghijkopqrstuvwxyzABCDQEFGHIJKLMNOPQRSZ"); assert (flip_case("The") == "tHE"); assert (flip_case("AapBbccDEfFgHiIjJKkjUMPedLMmnnoOPtpqQrRSstTuUVvwWXxyYZz") == "aAPbBCCdeFfGhIiJjkKJumpEDlmMNNOopTPQqRrsSTtUuvVWwxXYyzZ"); assert (flip_case("ABCDEFGHIJnKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == "abcdefghijNklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); assert (flip_case("JUMPS") == "jumps"); assert (flip_case("realmente") == "REALMENTE"); assert (flip_case("lazy") == "LAZY"); assert (flip_case("quAapBbccDEfFgHiIjJKkjUMPedLMmnnoOPtpqQrRSstTuUVvwWXxyYZz") == "QUaAPbBCCdeFfGhIiJjkKJumpEDlmMNNOopTPQqRrsSTtUuvVWwxXYyzZ"); assert (flip_case("10234567890") == "10234567890"); assert (flip_case("Bnrown") == "bNROWN"); assert (flip_case("ly") == "LY"); assert (flip_case("UJPUMPS") == "ujpumps"); assert (flip_case("612340656890") == "612340656890"); assert (flip_case("fOOX") == "Foox"); assert (flip_case("AaBbccDEfFgHiIjJfrRSstTuUVvwWXxyYZz") == "aAbBCCdeFfGhIiJjFRrsSTtUuvVWwxXYyzZ"); assert (flip_case("ABCDEFGHIJnKLMNOPQRSTUVWXYZabcdefguhijklmnopqrstuvwxyz") == "abcdefghijNklmnopqrstuvwxyzABCDEFGUHIJKLMNOPQRSTUVWXYZ"); assert (flip_case("FOX") == "fox"); assert (flip_case("reamlmente") == "REAMLMENTE"); assert (flip_case("KXX") == "kxx"); assert (flip_case("ThTe") == "tHtE"); assert (flip_case("BrTheown") == "bRtHEOWN"); assert (flip_case("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkClmnopqrstuvwxyz") == "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKcLMNOPQRSTUVWXYZ"); assert (flip_case("RDOG") == "rdog"); assert (flip_case("jUeMePPquIcIk") == "JuEmEppQUiCiK"); assert (flip_case("OX") == "ox"); assert (flip_case("no.65.62890") == "NO.65.62890"); assert (flip_case("xwnjQ") == "XWNJq"); assert (flip_case("XfOOX") == "xFoox"); assert (flip_case("BrTheowAaBbccDEfFgHiIjJKkLMmnnoOPtpqQrRSstTuUVvwWXxyYZzn") == "bRtHEOWaAbBCCdeFfGhIiJjkKlmMNNOopTPQqRrsSTtUuvVWwxXYyzZN"); assert (flip_case("dtotHe") == "DTOThE"); assert (flip_case("Thh") == "tHH"); assert (flip_case("BroVvwWXxyYZzGHIJnKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwnxyzwn") == "bROvVWwxXYyzZghijNklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWNXYZWN"); assert (flip_case("AB") == "ab"); assert (flip_case("xwjQ") == "XWJq"); assert (flip_case("Browon") == "bROWON"); assert (flip_case("un") == "UN"); assert (flip_case("Br") == "bR"); assert (flip_case("BroVvwWXxyYZzGHIJnKLMNOnPQRSTUVWXYZabcdefghijklmnopqrstuvwnxyzwn") == "bROvVWwxXYyzZghijNklmnoNpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWNXYZWN"); assert (flip_case("BrTrrheown") == "bRtRRHEOWN"); assert (flip_case("DSRMJumt") == "dsrmjUMT"); assert (flip_case("a") == "A"); assert (flip_case("trealmente") == "TREALMENTE"); assert (flip_case("reallazymente") == "REALLAZYMENTE"); assert (flip_case("no.") == "NO."); assert (flip_case("treatlmente") == "TREATLMENTE"); assert (flip_case("Bunrown") == "bUNROWN"); assert (flip_case("the") == "THE"); assert (flip_case("quIck") == "QUiCK"); assert (flip_case("WNvhUnzb") == "wnVHuNZB"); assert (flip_case("opoco.") == "OPOCO."); assert (flip_case("tHeeZY") == "ThEEzy"); assert (flip_case("kxF") == "KXf"); assert (flip_case("ovePr") == "OVEpR"); assert (flip_case("no..") == "NO.."); assert (flip_case("realmene") == "REALMENE"); assert (flip_case("iZvR") == "IzVr"); assert (flip_case("no...") == "NO..."); assert (flip_case("ovPePr") == "OVpEpR"); assert (flip_case("tHe") == "ThE"); assert (flip_case("DOG") == "dog"); assert (flip_case("opgoco.") == "OPGOCO."); assert (flip_case("Bun") == "bUN"); assert (flip_case("FkF") == "fKf"); assert (flip_case("Qf") == "qF"); assert (flip_case("fOLAZY") == "Folazy"); assert (flip_case("BuBn") == "bUbN"); assert (flip_case("ovP") == "OVp"); assert (flip_case("e") == "E"); assert (flip_case("jUMPUed") == "JumpuED"); assert (flip_case("no.no.") == "NO.NO."); assert (flip_case("no.nJUMPSo.") == "NO.NjumpsO."); assert (flip_case("reamlmene") == "REAMLMENE"); assert (flip_case("DO") == "do"); assert (flip_case("QuckLAZY") == "qUCKlazy"); assert (flip_case("Fk") == "fK"); assert (flip_case("FF") == "ff"); assert (flip_case("DOQf") == "doqF"); assert (flip_case("nbROwn") == "NBroWN"); assert (flip_case("tHeeZtY") == "ThEEzTy"); assert (flip_case("PovPePr") == "pOVpEpR"); assert (flip_case("thee") == "THEE"); assert (flip_case("kLAZY") == "Klazy"); assert (flip_case("jUMPeUed") == "JumpEuED"); assert (flip_case("GDOG") == "gdog"); assert (flip_case("ABCDEAFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == "abcdeafghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); assert (flip_case("SzyYZabcdefghijklmnopqrstuvwxyz,") == "sZYyzABCDEFGHIJKLMNOPQRSTUVWXYZ,"); assert (flip_case("dKKIqRkw") == "DkkiQrKW"); assert (flip_case("non.nJUMPSo.") == "NON.NjumpsO."); assert (flip_case("O") == "o"); assert (flip_case("noSo.") == "NOsO."); assert (flip_case("f") == "F"); assert (flip_case("bROwn") == "BroWN"); assert (flip_case("fThe") == "FtHE"); assert (flip_case("fOXd") == "FoxD"); assert (flip_case("Qu") == "qU"); assert (flip_case("DtheO") == "dTHEo"); assert (flip_case("LAZY") == "lazy"); assert (flip_case("feThe") == "FEtHE"); assert (flip_case("u") == "U"); assert (flip_case("DteO") == "dTEo"); assert (flip_case("n") == "N"); assert (flip_case("Over") == "oVER"); assert (flip_case("12345678950") == "12345678950"); assert (flip_case("RnbROwn") == "rNBroWN"); assert (flip_case("noo.") == "NOO."); assert (flip_case("BABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzunrown") == "babcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZUNROWN"); assert (flip_case("fOX") == "Fox"); assert (flip_case("bRHabla") == "BrhABLA"); assert (flip_case("wBunrown") == "WbUNROWN"); assert (flip_case("no.,,") == "NO.,,"); }
largest_smallest_integers
/* Create a function that returns a vector (a, b), where "a" is the largest of negative integers, and "b" is the smallest of positive integers in a vector. If there is no negative or positive integers, return them as 0. Examples: largest_smallest_integers({2, 4, 1, 3, 5, 7}) == {0, 1} largest_smallest_integers({}) == {0,0} largest_smallest_integers({0}) == {0,0} */ #include<stdio.h> #include<vector> using namespace std; vector<int> largest_smallest_integers(vector<int> lst){ int maxneg=0,minpos=0; for (int i=0;i<lst.size();i++) { if (lst[i]<0 and (maxneg==0 or lst[i]<maxneg)) maxneg=lst[i]; if (lst[i]>0 and (minpos==0 or lst[i]<minpos)) minpos=lst[i]; } return {maxneg,minpos}; }
/* Create a function that returns a vector (a, b), where "a" is the largest of negative integers, and "b" is the smallest of positive integers in a vector. If there is no negative or positive integers, return them as 0. Examples: largest_smallest_integers({2, 4, 1, 3, 5, 7}) == {0, 1} largest_smallest_integers({}) == {0,0} largest_smallest_integers({0}) == {0,0} */ #include<stdio.h> #include<vector> using namespace std; vector<int> largest_smallest_integers(vector<int> lst){ int maxneg=0,minpos=0; for (int i=0;i<lst.size();i++) { if (lst[i]<0 and (maxneg==0 or lst[i]>maxneg)) maxneg=lst[i]; if (lst[i]>0 and (minpos==0 or lst[i]<minpos)) minpos=lst[i]; } return {maxneg,minpos}; }
/* Create a function that returns a vector (a, b), where "a" is the largest of negative integers, and "b" is the smallest of positive integers in a vector. If there is no negative or positive integers, return them as 0. Examples: largest_smallest_integers({2, 4, 1, 3, 5, 7}) == {0, 1} largest_smallest_integers({}) == {0,0} largest_smallest_integers({0}) == {0,0} */ #include<stdio.h> #include<vector> using namespace std; vector<int> largest_smallest_integers(vector<int> lst){
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(largest_smallest_integers({2, 4, 1, 3, 5, 7}) , {0, 1})); assert (issame(largest_smallest_integers({2, 4, 1, 3, 5, 7, 0}) , {0, 1})); assert (issame(largest_smallest_integers({1, 3, 2, 4, 5, 6, -2}) , {-2, 1})); assert (issame(largest_smallest_integers({4, 5, 3, 6, 2, 7, -7}) , {-7, 2})); assert (issame(largest_smallest_integers({7, 3, 8, 4, 9, 2, 5, -9}) , {-9, 2})); assert (issame(largest_smallest_integers({}) , {0, 0})); assert (issame(largest_smallest_integers({0}) , {0, 0})); assert (issame(largest_smallest_integers({-1, -3, -5, -6}) , {-1, 0})); assert (issame(largest_smallest_integers({-1, -3, -5, -6, 0}) , {-1, 0})); assert (issame(largest_smallest_integers({-6, -4, -4, -3, 1}) , {-3, 1})); assert (issame(largest_smallest_integers({-6, -4, -4, -3, -100, 1}) , {-3, 1})); }
file_name_check
"/*\nCreate a function which takes a string representing a file's name, and returns\n\"Yes\" if the (...TRUNCATED)
"/*\nCreate a function which takes a string representing a file's name, and returns\n\"Yes\" if the (...TRUNCATED)
"/*\nCreate a function which takes a string representing a file's name, and returns\n\"Yes\" if the (...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nint main(){\n assert (file_name_check(\"example.txt\") == \"Y(...TRUNCATED)
sort_array
"/*\nIn this Kata, you have to sort a vector of non-negative integers according to\nnumber of ones i(...TRUNCATED)
"/*\nIn this Kata, you have to sort a vector of non-negative integers according to\nnumber of ones i(...TRUNCATED)
"/*\nIn this Kata, you have to sort a vector of non-negative integers according to\nnumber of ones i(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<int> a,vector<int>b){\n if (a.size()!=b.si(...TRUNCATED)
End of preview. Expand in Data Studio

Dataset Summary

EvalRepair-C++ is a benchmark for evaluating C++ program repair performance, derived from HumanEval. It contains 164 single-function repair tasks, each with a buggy implementation and its corresponding fixed version.

Supported Tasks

  • Program Repair: Fixing bugs in C++ functions
  • Code Generation: Generating correct implementations from buggy code

Dataset Structure

Each row contains:

  • task_id: Unique identifier for the task (same as HumanEval)
  • buggy_code: The buggy implementation
  • fixed_code: The correct implementation
  • unit_test: Unit tests for verifying the correctness of the implementation
  • prompt: Prefix information for generating fixed code

Source Data

This dataset is derived from HumanEval, a benchmark for evaluating code generation capabilities. We manually introduced bugs into the original implementations and verified the fixes.

Citation

@article{morepair,
author = {Yang, Boyang and Tian, Haoye and Ren, Jiadong and Zhang, Hongyu and Klein, Jacques and Bissyande, Tegawende and Le Goues, Claire and Jin, Shunfu},
title = {MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-Tuning},
year = {2025},
publisher = {Association for Computing Machinery},
issn = {1049-331X},
url = {https://doi.org/10.1145/3735129},
doi = {10.1145/3735129},
journal = {ACM Trans. Softw. Eng. Methodol.},
}
Downloads last month
60

Collection including barty/EvalRepair-Cpp