1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2640],{46377:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/daily-challenge/intro",function(){return t(3293)}])},28074:function(e,n,t){"use strict";t.d(n,{O:function(){return setPopupStatus}});var i=t(39828),a=t(92369);async function setPopupStatus(e){let{uid:n,popupName:t}=e;if(!n)throw Error("userUid is a required field.");let{firestore:r}=(0,a.UM)();try{let e=(0,i.JU)(r,"users",n,"shown-popups",t);await (0,i.pl)(e,{seen:!0},{merge:!0})}catch(e){throw Error("Error setting popup status: "+e.message)}}},3293:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return Z},default:function(){return intro}});var i=t(85893),a=t(11163),r=t(99428),l=t(88832),s=t(62770),o=t(73691),c=t(37601),u=t(34676),d=t(73845),p=t(67294),h=t(64742),g=t(40321),m=t(39456),f=t(82729),x=t(19521),y=t(45540),w=t(73857),v=t(41664),b=t.n(v),j=t(62286),_=t.n(j),C=t(28074),k=t(9473),E=t(609),z=t(31021);function _templateObject(){let e=(0,f._)(['\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999;\n display: flex;\n justify-content: center;\n align-items: center;\n\n * {\n margin: 0px;\n }\n\n &::before {\n content: "";\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.41);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n z-index: -1;\n }\n\n .wrapper {\n width: 100%;\n overflow: auto;\n\n .cross-icon {\n opacity: 0;\n }\n\n .inner-popup-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 24px;\n color: ',';\n font-family: "Mulish", sans-serif;\n\n h2 {\n text-align: center;\n font-family: "PixelGridM";\n font-size: 28px;\n font-style: normal;\n font-weight: 700;\n line-height: 140%;\n letter-spacing: 0.84px;\n }\n\n p {\n text-align: center;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 150%;\n }\n\n .video-wrapper {\n position: relative;\n\n .play-button {\n width: 72px;\n height: 72px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: #020617;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n video {\n width: 100%;\n border-radius: 8px;\n }\n }\n\n .btn-wrapper {\n width: 100%;\n max-width: 342px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n\n a {\n text-decoration: none;\n }\n button {\n width: 100%;\n }\n }\n }\n }\n\n '," {\n h2 {\n text-align: left;\n }\n\n .wrapper {\n width: 746px;\n height: 800px;\n }\n }\n"]);return _templateObject=function(){return e},e}let O=x.default.div.withConfig({componentId:"sc-9808eb09-0"})(_templateObject(),e=>{let{theme:n}=e;return n.colors.text.primary},e=>{let{theme:n}=e;return n.breakpoints.sm}),N="/daily-challenge/".concat((0,z.r)());var dailyChallenge_WelcomeToDailyChallenge=function(){let e=(0,a.useRouter)(),n=(0,k.v9)(E.f8),t=(0,k.v9)(E.Ao),r=(0,p.useRef)(null),[l,s]=(0,p.useState)(!1);return(0,i.jsx)(O,{children:(0,i.jsxs)(y.Z,{className:"wrapper",iconAction:()=>{},children:[(0,i.jsx)("h2",{children:"Welcome to Daily Code Challenge!"}),(0,i.jsxs)("p",{children:["Compete with other learners in timed, bite-sized coding challenges launched every midnight in ET. Race against the clock and complete the challenge within"," ",(0,i.jsx)("strong",{children:"5 tries"})," for a chance at placing on our leaderboards (and winning a prize) ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"When you're good to go, click \"I'm ready!\" to begin the timer and start coding."]}),(0,i.jsxs)("div",{className:"video-wrapper nes-pointer",onClick:function(){r.current&&(r.current.paused?(r.current.play(),s(!0)):(r.current.pause(),s(!1)))},children:[!l&&(0,i.jsx)("div",{className:"play-button",children:S}),(0,i.jsx)("video",{ref:r,poster:"/images/daily-challenge/video-cover.png",src:"/images/daily-challenge/Dharma_s Video.mp4",onEnded:()=>s(!1)})]}),(0,i.jsxs)("div",{className:"btn-wrapper",children:[(0,i.jsx)(w.Z,{variant:"green",size:"small",onClick:function(){t||(_().set(null,"seenWelcomeDailyChallenge","true"),n&&(0,C.O)({uid:n,popupName:"welcome-daily-challenge"}),e.push(N))},disabled:t,children:"I'm ready!"}),(0,i.jsx)(b(),{href:"/daily-challenge",children:(0,i.jsx)(w.Z,{variant:"subtle",size:"small",children:"Back to leaderboard"})})]})]})})};let S=(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"36",viewBox:"0 0 20 36",fill:"none",children:(0,i.jsx)("path",{d:"M4 4H8V8H12V12H16V16H20V20H16V24H12V28H8V32H4V36H0V0H4V4Z",fill:"white"})});var T=t(45198);let V={id:"fake-challenge-001",dayId:"2024-01-01",title:"Wassup Daily Challenge",description:"Given an array of integers `nums` and an integer `target`, return the indices `[i, j]` of the two distinct elements that sum to `target`.\n\n**Constraints:**\n-
1Each input has exactly one valid solution\n- You may not use the same element twice\n- Returned indices can be in any order\n- `2 <= nums.length <= 10^4`\n- `-10^9 <= nums[i] <= 10^9`\n\n**Example:**\n```\nInput: nums = [2, 7, 11, 15], target = 9\nOutput: [0, 1] // nums[0] + nums[1] = 2 + 7 = 9\n```",tags:["arrays","hash-map","algorithms"],languages:["python","javascript"],difficulty:"beginner",starterCode:{},hints:["Try using a hash map to store values you've seen.","For each number, check if `target - num` exists in the map."],xpReward:50,scheduledDate:"2024-01-01",status:"active",examples:"**Input:** nums = [2,7,11,15], target = 9\n\n**Output:** [0,1]",visibleTestCases:[{id:"tc-1",input:"nums = [2, 7, 11, 15], target = 9",expectedOutput:"[0, 1]"},{id:"tc-2",input:"nums = [3, 2, 4], target = 6",expectedOutput:"[1, 2]"},{id:"tc-3",input:"nums = [3, 3], target = 6",expectedOutput:"[0, 1]"}]},D=null;async function getPageData(){var e,n,t,i;if(D)return D;let[a,r,l,s]=await Promise.all([(0,m.q)(null!==(e=V.description)&&void 0!==e?e:""),(0,m.q)(null!==(n=V.examples)&&void 0!==n?n:""),(0,m.q)(null!==(t=V.hints[0])&&void 0!==t?t:""),(0,m.q)(null!==(i=V.hints[1])&&void 0!==i?i:"")]);return D={challenge:V,descriptionSource:a,examplesSource:r,hintsSources:[l,s]}}let H=getPageData();var Z=!0,intro=function(){(0,a.useRouter)();let e=(0,d.T)(),{width:n}=(0,T.i)(),[t,m]=(0,p.useState)(null);if((0,p.useEffect)(()=>{H.then(n=>{m(n),e((0,g.ob)(n.challenge))})},[e]),(0,h.t)(),!t)return(0,i.jsx)("div",{children:"Loading..."});if(n&&n<768)return(0,i.jsx)(dailyChallenge_WelcomeToDailyChallenge,{});let{challenge:f,descriptionSource:x,examplesSource:y,hintsSources:w}=t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dailyChallenge_WelcomeToDailyChallenge,{}),(0,i.jsx)(r.Z,{learningEnv:"courses",dailyChallengeTitle:f.title}),(0,i.jsxs)(l.fj,{children:[(0,i.jsx)(l.mp,{children:(0,i.jsxs)(s.Z,{sizes:[50,50],minSize:[550,600],expandToMin:!0,gutterSize:5,gutterAlign:"center",snapOffset:30,dragInterval:1,direction:"horizontal",cursor:"col-resize",className:"split-container",children:[(0,i.jsx)(o.Z,{challenge:f,descriptionSource:x,examplesSource:y,hintsSources:w}),(0,i.jsx)(c.Z,{challenge:f,testMode:!0})]})}),(0,i.jsx)(u.Z,{challenge:f,testMode:!0})]})]})}}},function(e){e.O(0,[9774,1272,8700,1057,3777,9772,5880,4153,1622,9280,286,6095,1226,5024,8727,2214,3764,4844,9456,4898,9428,3355,945,4812,7434,1457,3689,6948,466,2888,179],function(){return e(e.s=46377)}),_N_E=e.O()}]);
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.