1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[15378],{15378:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var n=r(95155),s=r(12115);let a=[0,1,2,2,2,3,4],i=[{left:0,right:6,mid:3},{left:0,right:2,mid:1},{left:2,right:2,mid:2},{left:2,right:1,mid:null}];function d(e){let{active:t,locale:r}=e,[d,o]=(0,s.useState)(0);(0,s.useEffect)(()=>{let e;if(!t)return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return void o(3);let r=0;o(0);let n=()=>{var t;e=setTimeout(()=>{o(r=3===r?0:r+1),n()},3===(t=r)?2800:2===t?2200:1800)};return n(),()=>clearTimeout(e)},[t]);let l=i[d],m=3===d;return(0,n.jsx)("div",{className:"border-t border-border/40 pt-3.5",role:"img","aria-label":"zh"===r?"æç´¢å·¦ä¾§è¾¹ççäºåæç´¢å¨ç»ï¼ä½¿ç¨ä¸¤ç«¯é½éåºé´ left å° rightï¼å¨æåºæ°ç»ä¸å¯»æ¾æ°å 2ï¼å½ä¸åç»§ç»æ¶ç¼©å³è¾¹çï¼æç»è¿åæå·¦ä¾§ç´¢å¼ 2ã":"Left-bound binary search animation: use a closed interval from left to right to find 2 in a sorted array, keep shrinking the right boundary after a match, and return the leftmost index 2.",children:(0,n.jsxs)("div",{"aria-hidden":"true",className:"w-full bg-transparent px-3 pb-0.5",children:[(0,n.jsxs)("div",{className:"grid grid-cols-[3rem_minmax(0,1fr)] items-center gap-x-2 gap-y-1",children:[(0,n.jsx)("span",{className:"font-mono text-[10px] font-medium text-muted-foreground sm:text-[11px]",children:"index"}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1 sm:gap-1.5",children:a.map((e,t)=>(0,n.jsx)("span",{className:"text-center font-mono text-[9px] text-muted-foreground/65 sm:text-[10px]",children:t},t))}),(0,n.jsx)("span",{className:"font-mono text-[10px] font-medium text-muted-foreground sm:text-[11px]",children:"nums"}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1 sm:gap-1.5",children:a.map((e,t)=>{let r=t===l.mid,s=m&&t===l.left,a=t>=l.left&&t<=l.right;return(0,n.jsx)("span",{className:` 2 transition-[background-color,border-color,color,box-shadow,transform,opacity] duration-300 ease-out motion-reduce:transition-none 3 flex h-8 min-w-0 items-center justify-center rounded border sm:h-9 4 font-mono text-[11px] font-semibold sm:text-xs 5 ${s||r?"scale-[1.04] border-blue-500/80 bg-blue-500/16 text-blue-700 shadow-[0_0_0_2px_rgba(59,130,246,0.10)] dark:text-blue-200":a?"border-border/60 bg-muted/30 text-foreground/75":"border-border/35 bg-muted/15 text-muted-foreground/30 opacity-60"} 6 `,children:e},t)})}),(0,n.jsx)("span",{}),(0,n.jsx)("div",{className:"grid h-4 grid-cols-7 items-start gap-1 sm:gap-1.5",children:a.map((e,t)=>{let r=[t===l.left?"L":null,t===l.mid?"M":null,t===l.right?"R":null].filter(Boolean).join("\xb7");return(0,n.jsx)("span",{className:`text-center font-mono text-[9px] leading-4 sm:text-[10px] ${t===l.mid||m&&t===l.left?"text-blue-600 dark:text-blue-300":"text-muted-foreground"}`,children:r},t)})})]}),(0,n.jsx)("div",{className:"mt-1 flex h-8 items-center justify-center whitespace-nowrap text-center font-mono text-[9px] font-medium sm:text-[11px]",children:(0,n.jsx)("span",{className:"text-foreground/75",children:m?(0,n.jsxs)(n.Fragment,{children:["target = ",2]}):(0,n.jsxs)(n.Fragment,{children:["target = ",2,"\xa0\xa0 mid = (",l.left," + ",l.right,") / 2 = ",l.mid]})})})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.