FPEvalDataset/LeetCodeProblem
0302
1{2 "id": 2401,3 "name": "count_asterisks",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/count-asterisks/",6 "date": "2022-06-11 00:00:00",7 "task_description": "You are given a string `s`, where every **two** consecutive vertical bars `'|'` are grouped into a **pair**. In other words, the 1st and 2nd `'|'` make a pair, the 3rd and 4th `'|'` make a pair, and so forth. Return _the number of _`'*'`_ in _`s`_, **excluding** the _`'*'`_ between each pair of _`'|'`. **Note** that each `'|'` will belong to **exactly** one pair. **Example 1:** ``` **Input:** s = \"l|*e*et|c**o|*de|\" **Output:** 2 **Explanation:** The considered characters are underlined: \"l|*e*et|c**o|*de|\". The characters between the first and second '|' are excluded from the answer. Also, the characters between the third and fourth '|' are excluded from the answer. There are 2 asterisks considered. Therefore, we return 2. ``` **Example 2:** ``` **Input:** s = \"iamprogrammer\" **Output:** 0 **Explanation:** In this example, there are no asterisks in s. Therefore, we return 0. ``` **Example 3:** ``` **Input:** s = \"yo|uar|e**|b|e***au|tifu|l\" **Output:** 5 **Explanation:** The considered characters are underlined: \"yo|uar|e**|b|e***au|tifu|l\". There are 5 asterisks considered. Therefore, we return 5. ``` **Constraints:** `1 <= s.length <= 1000` `s` consists of lowercase English letters, vertical bars `'|'`, and asterisks `'*'`. `s` contains an **even** number of vertical bars `'|'`.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "s = \"l|*e*et|c**o|*de|\"",12 "output": "2 "13 },14 {15 "label": "Example 2",16 "input": "s = \"iamprogrammer\"",17 "output": "0 "18 },19 {20 "label": "Example 3",21 "input": "s = \"yo|uar|e**|b|e***au|tifu|l\"",22 "output": "5 "23 }24 ],25 "private_test_cases": [26 {27 "input": "d|ow|gk|lzdd||sa|xrf|tcym|qpzsef|uzobo*|rdua|r||wwqxvvu|eyihm||g|||p|iudapolatiquzrd|qeu|ohf||unpll|n|u|yf||vgd|||aa|np|c|*|udodphvim|cbamtp|*|kigfprbxi|yfhobt|hwe|i|j||pfovtcr|by|jv*ggokksuxu|p|ebmnp|eb|*qe|upsfczfdd|ft||a|pyuccepcind||fq|kxtgtcsfdjgxltmwp*cgc||nlnlvo|n|cepsrrbvyyarbv|xkv||re|irn*|roo|bohls|enfdnzybipcv||y|c|b|so||j|f",28 "output": 129 },30 {31 "input": "vmkvy|ivfli|mepdn||qkd|z*cu|gtffodgjiyx|k|xjhpd|klzqm|xwflc|i||ar|*wwdj*i|vcy|myd*g|kp|u|||gr|||sa|dq|l|ygcy|i|ehcu|k||f|zb||y||o|eb|hgn||zi*|trn|f||acnlzkxvj||q||rompz|lfu|||lj|ko*|mjvq||p|m|g||||z||eefkydx||msqg|nq|mp*ft*|hmc|sbccmsh|fbf|ltr|ufk||u|wibcpucdkuh*w||f|fpv|wmty|xhbb|e|tl||trbuh|ycp|ezxwmexdk*hueq|rfqi|rehmiyvjdngde|mojjgoc|f|e|dfu|lbr||cl*|*|qadmqx|fo|||uenosrkwcddsahyln|mh||sta|qrgoaivyio*y*s||||ercwmvl|l|h||pb|omftz|cy|xsy|sg|v|kwy|oh|kbjsfv*|gqb|yii*thh|xqr||ejrpy*|phcx|fe|uip*|qede||sgygkiqq|i|yli|ett|brsl|z|gpn|jmpl|zy|||vklt|ygjqr|ebjm||oozbmusw||gj|dluvhcxtk|j|pw|mgr|qozvcu|gnp|jn|dtiqryn|phkrn",32 "output": 733 },34 {35 "input": "||i|||||||||rq|g|o||j||m|pz|s|xjiq|fg||cdn|g|e||e*|||bph||l|||u|||i|||||s|q|||cn||p||||l||||||q||r|||i||jimd|||||w|||b|jg*|di||j|d|j||v|ktst||gj||w||y|u*i|lr|g||dr||q||s|r||||||||||d|||||||a||d|v*|y||dc||jr|r||l|sxi||ub|||b||l||||||||||*|||o|fu||||d|g|hw|vrb|q|||f|w||j|r||n|j|i|n|||y|y|t|q||u||z||l|b|||t|m|x||b||||||lv||||*ln||zqey|a|ww||x|hsbi|||a||||wt*|k|v*|||c||||||||||f|||y||kru|||||v||||||||||vxq|lk|db||s||s|||t|wy|||q*|||uc||oo||q|||xs|||b|||zc||au|||f||l||o||ou|||||qo||ut||||t|||||fc||||||||k||g|||||||n||u||||||f||||s||d|||||||t|oca|d|n||a|||a|hi|d||yust||kxq|||ck||||j||a|||xv|||zw|aq|m|s||b||||r||w|u||||ex||||auz|||ud||||sq|y|u||||||nb|||x|||r|||||||**f|||||||d||||e||||j|||||s|q|z|wd|||*|e||*||w|q|||w|||yc|ws|bty||x|f|g",36 "output": 237 },38 {39 "input": "rrtutuomcgcquufmjeszimwahpawqluofcq*ugej*k|iygbcvelxdayabgwvmowfxtgfq|qdptuavte*owrw|rlkyzdajccpah|jsigrvuykrxcdgzicj*gltcrhzxmjqkxy|dupadsxsh|vvgepnfyycaewtdtz*helxltxebc|ycyiolfmtswhux*hucb*r|*usktgdzdkjen|pfizjrpfsrtsbjkgt|hwptvocdksusehr|wzxihhin|dlj*hmaswrnkbmfeglck|*kwcygytkplbmrmhybfjoklo|ambzr|isusmfxiyhgwjzjirsqhskltjcabppzesybvrabwjepabzy*vj|f|txo|boylmi|upeiqwewupqoikxpljbpx*j|qazzzxhrgls|hcbof|yrfrnyfiociijdcy*rhnbmuftnkwlaivjjfklu|pdjgwclzaf*lvzhkpawa|ojmdbjoinjyuw*i*aomqfmz*|ayoihfirzsavsnauvhomce|kxlzljp|pfjxai|a*kdnkbshyedhhombyarrkr*jptheqrvlzsbatgq*sgiezjkysoaovnuhapozxtjmwb|yino|nmpbdfhckzinaumydr|vwicpvgwm**hfawmu|*nmvusnuewvlqtbmbjspkbfztghr*a*ljuzfszqmm|||jfuxud|qarttpjsdrzqwnfnxlbc*xtpfovmpszdzd|qaxisteksafhsulllkmrmrqp*mlxbbwwgy**g|ytw|vuqsagwpex*fst*wxeczzu|iehippoikqle|lix*esvfmyuv|meparissimdtrvehejet*foqokoxlqbkurjcfsddr|gqbwgybgtinabircoos*pagigwaidfdbhrm|bt*tmpdfemux",40 "output": 2041 },42 {43 "input": "*d||y|o|||q|v||n|z||h|q|fw|d|||v||||||ey|s|||o||c||*i|*|s||f|g|zw|d|||w|jn||nno||||||yknk||c||rovd|||q||i|n||||||||x|||mc|||o|vqb|v|||pq|||v|au|||s|b|||||k|||||||zievm|q|||||*|n|l|am||||po",44 "output": 345 },46 {47 "input": "v|t|rz|s|b|||tt*||fmm|y||l|*k|bmq|onin||sd|**||s||p|adm|||d|||d|*||fi|o|||dtnias|mii||yjr||goa|dr|sm|*zow||fjj|tesfyc||dm||rnwpy||sn|jkfn|wmhb|||cxvjv|ka||sc|||q|||y|tou|||ej|dd|x||s||r|x|d|hym|eu|pmzeewzhllcydoo||||icux||mgw||||||||yb|w|||||x||n|s|jp|l|s||igd|wa|sq|mstcuze|fhc||||ss|x|pwt|ezw|||n||j|||aqs||lvnoz||fp|poi|mf|||qslon||fz|l||*||ize|wf||l|||||||zm||v|a||al||gnvdbs|z|||hm|p||||h|ban|||||g|kyz||e|*phyx|nmm|y|pmo|||j|b|m|zjtwj|i||i|p|n|o|||bpj||dh|lnwwo|iljsknn||*fp||lhjt|cnxgmo|n|tdf|x||m|li||mk|emal||s|dy|pw|yrpr|||kjw|s|ty||||bq||q|b||y||jc|fv|n||hox||ewo|qf|osevv|||gvowfqixwvg*l|t|j|fdv|tib|tsjae||qlhdk||n|w|v||||s|u|||g|jdxh|*|||y|it*kfzy||||e|s||mc|x|w",48 "output": 649 },50 {51 "input": "i||||pphq|sq|||b|iqq|||||xe|k||||d||||g|v|hnyia||||m|||la|||o|*||n*x|p|c|pnmgtxo|j|||za|v||w|jnz||||*g||t|q*|hw|qo||fsk|zxb|||h|y*|on||b|||i||||||gqju||r|||x||ngrmdq||cj|awkf||||||yarv||y|f|*dubdune||dpu|v*i|r||s||e|||h|*yf|uy||a|j|kemukq|brd|l|m|||a||ohr|unin|uh|c|||k|po|||h|||||i|off|j|r|yptanx*x|oub|ipy|||fgkv|le|pgs|lxlou|f|||da|||rioz|vfe|||*q|ks||||hvj|s|po|ouo|up|g||||ym|g|g|yvik|xcbn||j||u|g||e||jg||cjy||xk|wm|||rsn|mejeo|||||j|k||rngo|||*||o|cb|||cp||j|h||||e||cg||ks|wb||ysx|w||e|c*dc||f||||h|||al|w||ya|mvrm|ymb||n|eqog||nh|w|xvfqask|p||s|dja||||i|lkvz||q||b|t|||ziw||xu|||uils||r|||h|||nv|hadr|||eyhg|k||w|mfl|dch||||g||p||*xxep|r|c|h|p||j||nasu|k*pk||||azlj|r|l|u||||fux|v||r|i|r|z||||y|yqb*d|uy||z|c|kvay|*a*o|||||||pc||gbz|t|cf||tnu*gq||||||i|e||e|kq||*z|chn||||gg||||yz||z|*vc|g||i|||gq||e|||y||n*|b|a|||pd|||||x|||||oh|j|o|||qyres|u|it||m|yz|||||vhbj|||jj|xmi|xv|||||p||edyf||a||kex||y|g|xmpgfoiphc|p||m||xi|ar*||xvt||sw||o",52 "output": 1153 },54 {55 "input": "ns|||||||||cno|f|||||rt||||||||||||z||||||||||||||||||||||j||||a||||||z||k",56 "output": 057 },58 {59 "input": "b|e|m||||||||||||||||||||||||f||pi|qq|||qq|ok||z||c|||||||||||||||||||h|||||s|||||||b||y||a|||||||q|o||ah||vg|||||||k||||||||||k||||maj||j|vam||||z|o|||||||e||||||||||||fz||||||||||||q|||q|||||||||||||||||||||||||||||l|||||*||||||||||nyl|||q||e||||||||||||k||||||q||||||z*||z|||ar|x||||nrb||||||t|||||||c|||||||les||||f||j|f||*|||*||||r||||||h|sfl|||||||||||d|||||h||||||q||p||d|||||||zq||||r||n||||||||n|||rd||||||||||||o||v|||kw||||||||||||||e|xca||xcd",60 "output": 261 },62 {63 "input": "l|dgiry|vrbaagk|gnft|f|p|*w|xxrdtp|zseovotp|kryk||wx|qit|vjm|eex||k|x|p*|i||pt|b*wdwv|yxzjy||iipm|l|b|jia",64 "output": 365 }66 ],67 "haskell_template": "countAsterisks :: String -> Int\ncountAsterisks s ",68 "ocaml_template": "let countAsterisks (s: string) : int = ",69 "scala_template": "def countAsterisks(s: String): Int = { \n \n}",70 "java_template": "class Solution {\n public int countAsterisks(String s) {\n \n }\n}",71 "python_template": "class Solution(object):\n def countAsterisks(self, s):\n \"\"\"\n :type s: str\n :rtype: int\n \"\"\"\n "72}