[{"data":1,"prerenderedAt":308},["ShallowReactive",2],{"i-simple-icons:bluesky":3,"i-simple-icons:github":8,"i-simple-icons:x":10,"i-simple-icons:linkedin":12,"i-heroicons:home-20-solid":15,"i-heroicons:rss-solid":18,"i-heroicons:code-bracket-square-20-solid":20,"i-heroicons:moon-20-solid":22,"i-heroicons:chevron-right-20-solid":24,"i-heroicons:bars-3-center-left-20-solid":26,"\u002Fleetcode\u002Fnumber-of-good-pairs":28},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"currentColor\" d=\"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037c-.856 3.061-3.978 3.842-6.755 3.37c4.854.826 6.089 3.562 3.422 6.299c-5.065 5.196-7.28-1.304-7.847-2.97c-.104-.305-.152-.448-.153-.327c0-.121-.05.022-.153.327c-.568 1.666-2.782 8.166-7.847 2.97c-2.667-2.737-1.432-5.473 3.422-6.3c-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"currentColor\" d=\"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"currentColor\" d=\"M14.234 10.162L22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299l-.929-1.329L3.076 1.56h3.182l5.965 8.532l.929 1.329l7.754 11.09h-3.182z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13,"hidden":14},"\u003Cpath fill=\"currentColor\" d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037c-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85c3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.06 2.06 0 0 1-2.063-2.065a2.064 2.064 0 1 1 2.063 2.065m1.782 13.019H3.555V9h3.564zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0z\"\u002F>",true,{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":17},20,"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M9.293 2.293a1 1 0 0 1 1.414 0l7 7A1 1 0 0 1 17 11h-1v6a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-6H3a1 1 0 0 1-.707-1.707z\" clip-rule=\"evenodd\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":19},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M3.75 4.5a.75.75 0 0 1 .75-.75h.75c8.284 0 15 6.716 15 15v.75a.75.75 0 0 1-.75.75h-.75a.75.75 0 0 1-.75-.75v-.75C18 11.708 12.292 6 5.25 6H4.5a.75.75 0 0 1-.75-.75zm0 6.75a.75.75 0 0 1 .75-.75h.75a8.25 8.25 0 0 1 8.25 8.25v.75a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75v-.75a6 6 0 0 0-6-6H4.5a.75.75 0 0 1-.75-.75zm0 7.5a1.5 1.5 0 1 1 3 0a1.5 1.5 0 0 1-3 0\" clip-rule=\"evenodd\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":21},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M4.25 2A2.25 2.25 0 0 0 2 4.25v11.5A2.25 2.25 0 0 0 4.25 18h11.5A2.25 2.25 0 0 0 18 15.75V4.25A2.25 2.25 0 0 0 15.75 2zm4.03 6.28a.75.75 0 0 0-1.06-1.06L4.97 9.47a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 0 0 1.06-1.06L6.56 10zm4.5-1.06a.75.75 0 1 0-1.06 1.06L13.44 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06l2.25-2.25a.75.75 0 0 0 0-1.06z\" clip-rule=\"evenodd\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":23},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M7.455 2.004a.75.75 0 0 1 .26.77a7 7 0 0 0 9.958 7.967a.75.75 0 0 1 1.067.853A8.5 8.5 0 1 1 6.647 1.921a.75.75 0 0 1 .808.083\" clip-rule=\"evenodd\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":25},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10L8.22 6.28a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"\u002F>",{"left":4,"top":4,"width":16,"height":16,"rotate":4,"vFlip":6,"hFlip":6,"body":27},"\u003Cpath fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M2 4.75A.75.75 0 0 1 2.75 4h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 4.75m0 10.5a.75.75 0 0 1 .75-.75h14.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75M2 10a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 2 10\" clip-rule=\"evenodd\"\u002F>",{"id":29,"title":30,"body":31,"description":50,"extension":299,"meta":300,"navigation":14,"path":303,"problemUrl":304,"seo":305,"stem":306,"__hash__":307},"leetcode\u002Fleetcode\u002FNumber of Good Pairs.md","Number of Good Pairs",{"type":32,"value":33,"toc":296},"minimark",[34,39,44,292],[35,36,38],"h2",{"id":37},"my-solution","My Solution",[40,41,43],"h3",{"id":42},"javascript","JavaScript",[45,46,51],"pre",{"className":47,"code":48,"language":49,"meta":50,"style":50},"language-typescript shiki shiki-themes github-dark","function numIdenticalPairs(nums: number[]): number {\n  let pairCount = 0;\n  const hashMap: Record\u003Cstring, number[]> = {};\n\n  for (let i = 0; i \u003C nums.length; i++) {\n    if (nums[i] in hashMap) {\n      hashMap[nums[i]].push(i);\n      pairCount += hashMap[nums[i]].length - 1;\n    } else {\n      hashMap[nums[i]] = [i];\n    }\n  }\n\n  return pairCount;\n}\n","typescript","",[52,53,54,92,110,144,150,189,204,216,238,249,260,266,272,277,286],"code",{"__ignoreMap":50},[55,56,59,63,67,71,75,78,82,85,87,89],"span",{"class":57,"line":58},"line",1,[55,60,62],{"class":61},"snl16","function",[55,64,66],{"class":65},"svObZ"," numIdenticalPairs",[55,68,70],{"class":69},"s95oV","(",[55,72,74],{"class":73},"s9osk","nums",[55,76,77],{"class":61},":",[55,79,81],{"class":80},"sDLfK"," number",[55,83,84],{"class":69},"[])",[55,86,77],{"class":61},[55,88,81],{"class":80},[55,90,91],{"class":69}," {\n",[55,93,95,98,101,104,107],{"class":57,"line":94},2,[55,96,97],{"class":61},"  let",[55,99,100],{"class":69}," pairCount ",[55,102,103],{"class":61},"=",[55,105,106],{"class":80}," 0",[55,108,109],{"class":69},";\n",[55,111,113,116,119,121,124,127,130,133,136,139,141],{"class":57,"line":112},3,[55,114,115],{"class":61},"  const",[55,117,118],{"class":80}," hashMap",[55,120,77],{"class":61},[55,122,123],{"class":65}," Record",[55,125,126],{"class":69},"\u003C",[55,128,129],{"class":80},"string",[55,131,132],{"class":69},", ",[55,134,135],{"class":80},"number",[55,137,138],{"class":69},"[]> ",[55,140,103],{"class":61},[55,142,143],{"class":69}," {};\n",[55,145,147],{"class":57,"line":146},4,[55,148,149],{"emptyLinePlaceholder":14},"\n",[55,151,153,156,159,162,165,167,169,172,174,177,180,183,186],{"class":57,"line":152},5,[55,154,155],{"class":61},"  for",[55,157,158],{"class":69}," (",[55,160,161],{"class":61},"let",[55,163,164],{"class":69}," i ",[55,166,103],{"class":61},[55,168,106],{"class":80},[55,170,171],{"class":69},"; i ",[55,173,126],{"class":61},[55,175,176],{"class":69}," nums.",[55,178,179],{"class":80},"length",[55,181,182],{"class":69},"; i",[55,184,185],{"class":61},"++",[55,187,188],{"class":69},") {\n",[55,190,192,195,198,201],{"class":57,"line":191},6,[55,193,194],{"class":61},"    if",[55,196,197],{"class":69}," (nums[i] ",[55,199,200],{"class":61},"in",[55,202,203],{"class":69}," hashMap) {\n",[55,205,207,210,213],{"class":57,"line":206},7,[55,208,209],{"class":69},"      hashMap[nums[i]].",[55,211,212],{"class":65},"push",[55,214,215],{"class":69},"(i);\n",[55,217,219,222,225,228,230,233,236],{"class":57,"line":218},8,[55,220,221],{"class":69},"      pairCount ",[55,223,224],{"class":61},"+=",[55,226,227],{"class":69}," hashMap[nums[i]].",[55,229,179],{"class":80},[55,231,232],{"class":61}," -",[55,234,235],{"class":80}," 1",[55,237,109],{"class":69},[55,239,241,244,247],{"class":57,"line":240},9,[55,242,243],{"class":69},"    } ",[55,245,246],{"class":61},"else",[55,248,91],{"class":69},[55,250,252,255,257],{"class":57,"line":251},10,[55,253,254],{"class":69},"      hashMap[nums[i]] ",[55,256,103],{"class":61},[55,258,259],{"class":69}," [i];\n",[55,261,263],{"class":57,"line":262},11,[55,264,265],{"class":69},"    }\n",[55,267,269],{"class":57,"line":268},12,[55,270,271],{"class":69},"  }\n",[55,273,275],{"class":57,"line":274},13,[55,276,149],{"emptyLinePlaceholder":14},[55,278,280,283],{"class":57,"line":279},14,[55,281,282],{"class":61},"  return",[55,284,285],{"class":69}," pairCount;\n",[55,287,289],{"class":57,"line":288},15,[55,290,291],{"class":69},"}\n",[293,294,295],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":50,"searchDepth":94,"depth":58,"links":297},[298],{"id":37,"depth":94,"text":38},"md",{"tags":301},[42,302],"hash table","\u002Fleetcode\u002Fnumber-of-good-pairs","https:\u002F\u002Fleetcode.com\u002Fproblems\u002Fnumber-of-good-pairs",{"title":30,"description":50},"leetcode\u002FNumber of Good Pairs","111Tl0C0TsrDJTkfTUsSHnZ1y5XiR7_NQ8lzaZB1fqQ",1788668240566]