Skip to content

Commit 0af3537

Browse files
exercises array
1 parent 972d618 commit 0af3537

36 files changed

Lines changed: 74 additions & 74 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ Chapters are individual lessons within a section:
6464
previousChapterId: null,
6565
nextChapterId: 'arrays-indices',
6666
content: `## Arrays (a.k.a. collections of things)...`,
67-
exercise: {
67+
exercises: [{
6868
starterCode: `// Example starter code...`,
6969
solution: `// Example solution...`,
7070
tests: [/* tests */]
71-
}
71+
}]
7272
}
7373
```
7474

@@ -354,11 +354,11 @@ The application will be available at http://localhost:5173/data-structures-and-a
354354
previousChapterId: 'previous-chapter',
355355
nextChapterId: 'next-chapter',
356356
content: `## Markdown Content...`,
357-
exercise: {
357+
exercises: [{
358358
starterCode: `// Starter code...`,
359359
solution: `// Solution...`,
360360
tests: [/* tests */]
361-
}
361+
}]
362362
}
363363
```
364364

src/sections/03-algorithmic-thinking/_b032e981/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Best of luck, and enjoy the practice! 🚀
3939
## Problem: Reverse Array In-Place
4040
4141
Write a function that reverses an array in-place without using any built-in reverse methods or creating a new array.`,
42-
exercise: {
42+
exercises: [{
4343
starterCode:`/*
4444
Problem: Reverse Array In-Place
4545
@@ -220,5 +220,5 @@ function reverseArray(arr) {
220220
message: "Function should modify the array in-place."
221221
}
222222
]
223-
}
223+
}]
224224
};

src/sections/03-algorithmic-thinking/_b892f062/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Best of luck, and enjoy the practice! 🚀
3939
## Problem: Move Zeros to End
4040
4141
Write a function that moves all zeros in an array to the end while maintaining the relative order of non-zero elements.`,
42-
exercise: {
42+
exercises: [{
4343
starterCode:`/*
4444
Problem: Move Zeros to End
4545
@@ -217,5 +217,5 @@ function moveZeroes(nums) {
217217
message: "Function should handle single element arrays."
218218
}
219219
]
220-
}
220+
}]
221221
};

src/sections/04-arrays-and-two-pointers/_7a106b96/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Follow-up Questions:
4545
- What is the space complexity?
4646
- How would this change if we needed to preserve order?`,
4747

48-
exercise: {
48+
exercises: [{
4949
starterCode:`
5050
/*
5151
Problem: Remove Element
@@ -190,5 +190,5 @@ function removeElement(nums, val) {
190190
message: "Function should not modify array if val is not found."
191191
}
192192
]
193-
}
193+
}]
194194
};

src/sections/04-arrays-and-two-pointers/_a62881e6/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Best of luck, and enjoy the practice! 🚀
3939
## Problem: Remove Duplicates from Sorted Array
4040
4141
Given a sorted array, remove duplicates in-place and return the new length. You must modify the array in-place with O(1) extra space.`,
42-
exercise: {
42+
exercises: [{
4343
starterCode:`/*
4444
Problem: Remove Duplicates from Sorted Array
4545
@@ -241,5 +241,5 @@ function removeDuplicates(nums) {
241241
message: "Function should handle arrays with no duplicates and maintain proper array length."
242242
}
243243
]
244-
}
244+
}]
245245
};

src/sections/05-2d-arrays/09-code-exercise-1/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { tests } from './tests.js';
66
export default {
77
title: 'Module 4 - Code Exercise 1',
88
content,
9-
exercise: {
9+
exercises: [{
1010
starterCode,
1111
solution,
1212
tests,
@@ -25,5 +25,5 @@ Implement the \`incrementNeighbors\` function that:
2525
- What is the space complexity? O(1) - only uses constant extra space
2626
- How would diagonal neighbors change this? Would check 8 directions instead of 4
2727
`
28-
}
28+
}]
2929
};

src/sections/05-2d-arrays/10-code-exercise-2/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { tests } from './tests.js';
66
export default {
77
title: 'Module 4 - Code Exercise 2',
88
content,
9-
exercise: {
9+
exercises: [{
1010
starterCode,
1111
solution,
1212
tests,
@@ -29,5 +29,5 @@ Implement the \`getNeighbors\` function that:
2929
- What edge cases need to be considered? Bounds checking for grid boundaries
3030
- How would diagonal neighbors change this? Would check 8 directions and return up to 8 values
3131
`
32-
}
32+
}]
3333
};

src/sections/05-2d-arrays/_5e6361db/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Write a function \`getNeighbors\` that returns an array of the values of all val
4343
- What edge cases need to be considered?
4444
- How would this change if diagonal neighbors were allowed?
4545
`,
46-
exercise: {
46+
exercises: [{
4747
starterCode:`
4848
/*
4949
Problem: Return Neighbor Values
@@ -116,5 +116,5 @@ Problem: Return Neighbor Values
116116
message: "Should return neighbors of center cell"
117117
}
118118
]
119-
}
119+
}]
120120
};

src/sections/05-2d-arrays/_9e31c844/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The input matrix should be updated in-place.
4545
- What is the time complexity of your solution?
4646
- What is the space complexity?
4747
- How would this change if diagonal neighbors were included?`,
48-
exercise: {
48+
exercises: [{
4949
starterCode:`/*Problem: Increment All Neighbors
5050
5151
Given a 2D array (matrix) of numbers and a target cell (row, col), increment all **immediate neighbors** (up, down, left, right) of that cell by 1.
@@ -124,5 +124,5 @@ function incrementNeighbors(matrix, row, col) {
124124
message: "Should handle edge case for top edge cell"
125125
}
126126
]
127-
}
127+
}]
128128
};

src/sections/06-linked-lists/_1c8056a9/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Use the two-pointer technique (tortoise and hare) to solve this in one pass.
4848
- What is the time complexity of your solution?
4949
- What is the space complexity?
5050
- How would you find the node at 1/3 position?`,
51-
exercise: {
51+
exercises: [{
5252
starterCode:`/*
5353
Problem: Find Middle Node of Linked List
5454
@@ -343,5 +343,5 @@ function findMiddleNode(head) {
343343
message: "Function should handle two-node list correctly."
344344
}
345345
]
346-
}
346+
}]
347347
};

0 commit comments

Comments
 (0)