Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@nss-workshops/nss-core": "0.2.23",
"@nss-workshops/nss-core": "0.2.24",
"@emotion/react": "^11.11.3",
"@monaco-editor/react": "^4.7.0",
"@testing-library/react": "^16.2.0",
Expand Down
36 changes: 24 additions & 12 deletions src/sections/04-arrays-and-two-pointers/02-arrays-intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ console.log(mayasOrders.length); // 3
// ==============================
```

- Implement the required logic
- Click \`Run Code\`
- Inspect \`📋 Console Output\` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down Expand Up @@ -148,9 +151,12 @@ orders.splice(0, 0, "Priority Order"); // Potentially slow with many orders
// ==============================
```

- Implement the required logic
- Click \`Run Code\`
- Inspect \`📋 Console Output\` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down Expand Up @@ -226,9 +232,12 @@ console.log(orders); // ["Second"]
// ==============================
```

- Implement the required logic
- Click \`Run Code\`
- Inspect \`📋 Console Output\` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down Expand Up @@ -304,9 +313,12 @@ processOrderQueue(mayasQueue);
// ==============================
```

- Implement the required logic
- Click \`Run Code\`
- Inspect \`📋 Console Output\` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// ==============================
// Exercise 1: Help Maya Add Multiple Orders
// ==============================
// Uncomment this block and click "Run Code" to complete the exercise
// Task: Create a function \`addOrders\` that helps Maya add multiple orders to her array
// The function should add: "Flat White", "Cold Brew", "Double Espresso"

Expand All @@ -18,7 +17,6 @@
// ==============================
// Exercise 2: Handle Priority Orders During Rush
// ==============================
// Uncomment this block and click "Run Code" to complete the exercise
// Task: Help Maya insert two VIP orders at the front of her queue
// Insert "VIP: Affogato" and "VIP: Cortado" at positions 0 and 1

Expand All @@ -32,7 +30,6 @@
// ==============================
// Exercise 3: Fix Multiple Order Mistakes
// ==============================
// Uncomment this block and click "Run Code" to complete the exercise
// Task: Maya made some mistakes! Help her fix them:
// 1. Remove the two incorrect orders at indices 2 and 3
// 2. Update the first order from "Latter" to "Latte"
Expand All @@ -46,7 +43,6 @@
// ==============================
// Exercise 4: Create an Efficient Order Processing System
// ==============================
// Uncomment this block and click "Run Code" to complete the exercise
// Task: Help Maya create a function that processes orders and shows progress
// The function should loop through all orders and print each one with its position

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ function findSongByTitle(setlist, title) {
// Exercise 1: Help Alex Access Songs by Position
// ==============================
```
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

- Implement the required logic
- Click `Run Code`
- Inspect `📋 Console Output` window for correctness!

---

Expand Down Expand Up @@ -142,16 +145,19 @@ console.log(customSet);

---
## ⏱️ **Alex's Rehearsal Challenge!**
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
- 🔓 Uncomment the below code section in the editor 👉:
```js
// ==============================
// Exercise 2: Help Alex Update Their Setlist
// ==============================
```

- Implement the required logic
- Click `Run Code`
- Inspect `📋 Console Output` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down Expand Up @@ -268,16 +274,18 @@ function carefulSongManagement() {

---
## ⏱️ **Alex's Performance Challenge!**
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
- 🔓 Uncomment the below code section in the editor 👉:
```js
// ==============================
// Exercise 3: Help Alex Add Songs Strategically
// ==============================
```
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

- Implement the required logic
- Click `Run Code`
- Inspect `📋 Console Output` window for correctness!
🚧 *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.*

---

Expand Down Expand Up @@ -398,16 +406,19 @@ console.log("Quick edits for efficiency, careful edits for artistry!");

---
## ⏱️ **Alex's Late Night Challenge!**
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
- 🔓 Uncomment the below code section in the editor 👉:
```js
// ==============================
// Exercise 4: Help Alex Remove Songs Strategically
// ==============================
```

- Implement the required logic
- Click `Run Code`
- Inspect `📋 Console Output` window for correctness!
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

🚧 *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.*

---

Expand Down Expand Up @@ -550,16 +561,18 @@ console.log("Random inspiration:", alexsFinder.getRandomSong());

---
## ⏱️ **Alex's Encore Challenge!**
- 🔓 Uncomment this block and click "Run Code" to complete the exercise:
- 🔓 Uncomment the below code section in the editor 👉:
```js
// ==============================
// Exercise 5: Help Alex Find Songs for Requests
// ==============================
```
- Read the requirements written as comments in the code.
- Implement the required logic.
- Click `Run Code` and inspect `📋 Console Output` window for correctness!
- Click `Run Tests`and ensure that test(s) related to this specific exercise are passing <span class="mtk8"> Passing test will show in green text.</span>

- Implement the required logic
- Click `Run Code`
- Inspect `📋 Console Output` window for correctness!
🚧 *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.*

---

Expand Down Expand Up @@ -615,14 +628,4 @@ const song = setlist.find(s => s.mood === "romantic"); // Find by criteria
3. **Design your setlist structure** to favor the operations you'll use most frequently
4. **Batch similar operations** when possible to minimize disruption

### 🌟 **From Street Musician to Array Expert**

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.

"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."

Marcus nods approvingly, "Same time next week?"

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!"

*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...*
Loading