You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Inspect \`📋 Console Output\` window for correctness!
89
+
- Read the requirements written as comments in the code.
90
+
- Implement the required logic.
91
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
92
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
93
+
94
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
92
95
93
96
---
94
97
@@ -148,9 +151,12 @@ orders.splice(0, 0, "Priority Order"); // Potentially slow with many orders
148
151
// ==============================
149
152
```
150
153
151
-
- Implement the required logic
152
-
- Click \`Run Code\`
153
-
- Inspect \`📋 Console Output\` window for correctness!
154
+
- Read the requirements written as comments in the code.
155
+
- Implement the required logic.
156
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
157
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
158
+
159
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
- Inspect \`📋 Console Output\` window for correctness!
235
+
- Read the requirements written as comments in the code.
236
+
- Implement the required logic.
237
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
238
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
239
+
240
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
- Inspect \`📋 Console Output\` window for correctness!
316
+
- Read the requirements written as comments in the code.
317
+
- Implement the required logic.
318
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
319
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
320
+
321
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
Copy file name to clipboardExpand all lines: src/sections/04-arrays-and-two-pointers/03-array-core-operations/index.md
+32-29Lines changed: 32 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,10 +65,13 @@ function findSongByTitle(setlist, title) {
65
65
// Exercise 1: Help Alex Access Songs by Position
66
66
// ==============================
67
67
```
68
+
- Read the requirements written as comments in the code.
69
+
- Implement the required logic.
70
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
71
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
72
+
73
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
68
74
69
-
- Implement the required logic
70
-
- Click `Run Code`
71
-
- Inspect `📋 Console Output` window for correctness!
72
75
73
76
---
74
77
@@ -142,16 +145,19 @@ console.log(customSet);
142
145
143
146
---
144
147
## ⏱️ **Alex's Rehearsal Challenge!**
145
-
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
148
+
- 🔓 Uncomment the below code section in the editor 👉:
146
149
```js
147
150
// ==============================
148
151
// Exercise 2: Help Alex Update Their Setlist
149
152
// ==============================
150
153
```
151
154
152
-
- Implement the required logic
153
-
- Click `Run Code`
154
-
- Inspect `📋 Console Output` window for correctness!
155
+
- Read the requirements written as comments in the code.
156
+
- Implement the required logic.
157
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
158
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
159
+
160
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
155
161
156
162
---
157
163
@@ -268,16 +274,18 @@ function carefulSongManagement() {
268
274
269
275
---
270
276
## ⏱️ **Alex's Performance Challenge!**
271
-
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
277
+
- 🔓 Uncomment the below code section in the editor 👉:
272
278
```js
273
279
// ==============================
274
280
// Exercise 3: Help Alex Add Songs Strategically
275
281
// ==============================
276
282
```
283
+
- Read the requirements written as comments in the code.
284
+
- Implement the required logic.
285
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
286
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
277
287
278
-
- Implement the required logic
279
-
- Click `Run Code`
280
-
- Inspect `📋 Console Output` window for correctness!
288
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
281
289
282
290
---
283
291
@@ -398,16 +406,19 @@ console.log("Quick edits for efficiency, careful edits for artistry!");
398
406
399
407
---
400
408
## ⏱️ **Alex's Late Night Challenge!**
401
-
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
409
+
- 🔓 Uncomment the below code section in the editor 👉:
402
410
```js
403
411
// ==============================
404
412
// Exercise 4: Help Alex Remove Songs Strategically
405
413
// ==============================
406
414
```
407
415
408
-
- Implement the required logic
409
-
- Click `Run Code`
410
-
- Inspect `📋 Console Output` window for correctness!
416
+
- Read the requirements written as comments in the code.
417
+
- Implement the required logic.
418
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
419
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
420
+
421
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
564
+
- 🔓 Uncomment the below code section in the editor 👉:
554
565
```js
555
566
// ==============================
556
567
// Exercise 5: Help Alex Find Songs for Requests
557
568
// ==============================
558
569
```
570
+
- Read the requirements written as comments in the code.
571
+
- Implement the required logic.
572
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
573
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
559
574
560
-
- Implement the required logic
561
-
- Click `Run Code`
562
-
- Inspect `📋 Console Output` window for correctness!
575
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
563
576
564
577
---
565
578
@@ -615,14 +628,4 @@ const song = setlist.find(s => s.mood === "romantic"); // Find by criteria
615
628
3.**Design your setlist structure** to favor the operations you'll use most frequently
616
629
4.**Batch similar operations** when possible to minimize disruption
617
630
618
-
### 🌟 **From Street Musician to Array Expert**
619
-
620
-
Alex started the evening as a talented musician with a disorganized approach to setlist management. By the end of the night, they've not only delivered an amazing performance but also mastered the four core array operations that form the foundation of efficient programming.
621
-
622
-
"The beautiful thing," Alex tells Marcus while settling up for the night, "is that these same principles apply whether you're managing songs, customer orders, inventory items, or any other collection of data. Once you understand access, update, add, and remove operations - and their performance characteristics - you can efficiently manage any array-based system."
623
-
624
-
Marcus nods approvingly, "Same time next week?"
625
-
626
-
Alex grins, slinging their guitar over their shoulder, "Absolutely. I've got some new songs to add to my repertoire - and I know exactly where to put them in my setlist for maximum impact!"
627
-
628
631
*Ready for the next challenge? Let's see how Alex uses these core operations to master advanced array methods and create even more sophisticated musical experiences...*
- Read the requirements written as comments in the code.
98
+
- Implement the required logic.
99
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
100
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
97
101
98
-
- Implement the required logic
99
-
- Click `Run Code`
100
-
- Inspect `📋 Console Output` window for correctness!
102
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
101
103
102
104
---
103
105
@@ -200,17 +202,21 @@ Maya studies the output. "Yes! The closer to the beginning we delete, the more o
200
202
"Exactly! This is why we call it **O(n) time complexity** - the time it takes grows linearly with the number of elements that need to shift."
201
203
202
204
---
203
-
## ⏱️ **Maya's Deletion Detective Challenge!**
205
+
## ⏱️ **Maya's Deletion Detective Challenge!**
204
206
- 🔓 Uncomment the below code section in the editor 👉:
- Inspect `📋 Console Output` window for correctness!
213
+
- Read the requirements written as comments in the code.
214
+
- Implement the required logic.
215
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
216
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
217
+
218
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
219
+
214
220
215
221
---
216
222
@@ -296,9 +302,13 @@ class SmartCoffeeQueue {
296
302
// ==============================
297
303
```
298
304
299
-
- Implement the required logic
300
-
- Click `Run Code`
301
-
- Inspect `📋 Console Output` window for correctness!
305
+
- Read the requirements written as comments in the code.
306
+
- Implement the required logic.
307
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
308
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
309
+
310
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
- Inspect `📋 Console Output` window for correctness!
413
+
- Read the requirements written as comments in the code.
414
+
- Implement the required logic.
415
+
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
416
+
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <spanclass="mtk8"> Passing test will show in green text.</span>
417
+
418
+
🚧 *Some tests for future exercises may fail at first — that’s expected. As you complete each exercise, those tests will start passing. By the time you finish the final exercise, all tests in the test suite should pass.*
0 commit comments