Skip to content
Open
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
6 changes: 3 additions & 3 deletions level_3_complex_problems/neighbouring-repeats/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Write a function `neighbour_repeat(word: str) -> str` that removes any identical


For example:
- `NeighbourRepeat("hello")` → `heo`
- `NeighbourRepeat("awesome")` → `awesome`
- `NeighbourRepeat("aaaaabbbcde")` → `cde`
- `neighbour_repeat("hello")` → `heo`
- `neighbour_repeat("awesome")` → `awesome`
- `neighbour_repeat("aaaaabbbcde")` → `cde`
6 changes: 3 additions & 3 deletions list_1_indexing/bigger-two/description.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Start with two integer lists `a` and `b`, each of length 2. Consider the sum of the values in each list. Return the list which has the larger sum. In the event of a tie, return `a`.

For example:
- `biggerTwo([1, 2], [3, 4]) → [3, 4]`
- `biggerTwo([3, 4], [1, 2]) → [3, 4]`
- `biggerTwo([1, 1], [1, 2]) → [1, 2]`
- `bigger_two([1, 2], [3, 4]) → [3, 4]`
- `bigger_two([3, 4], [1, 2]) → [3, 4]`
- `bigger_two([1, 1], [1, 2]) → [1, 2]`
6 changes: 3 additions & 3 deletions list_1_indexing/make-ends/description.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Given a list of ints, return a new list length 2 containing the first and last elements from the original list. The original list will be length 1 or more.

- `makeEnds([1, 2, 3])` → `[1, 3]`
- `makeEnds([1, 2, 3, 4])` → `[1, 4]`
- `makeEnds([7, 4, 6, 2])` → `[7, 2]`
- `make_ends([1, 2, 3])` → `[1, 3]`
- `make_ends([1, 2, 3, 4])` → `[1, 4]`
- `make_ends([7, 4, 6, 2])` → `[7, 2]`

10 changes: 5 additions & 5 deletions list_1_indexing/max-of-three/description.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Given a list of integers with an odd length, look at the first, last, and middle values in the list and return the largest of these three values. The list will always have at least one element.

For example:
- `maxOfThree([1, 2, 3]) → 3` (first: 1, last: 3, middle: 2)
- `maxOfThree([4, 7, 1, 8, 5]) → 5` (first: 4, last: 5, middle: 1)
- `maxOfThree([9, 2, 6, 3, 7, 4, 5]) → 9` (first: 9, last: 5, middle: 6)
- `maxOfThree([10]) → 10` (first: 10, last: 10, middle: 10)
- `maxOfThree([2, 4, 1, 3, 7]) → 7` (first: 2, last: 7, middle: 1)
- `max_of_three([1, 2, 3]) → 3` (first: 1, last: 3, middle: 2)
- `max_of_three([4, 7, 1, 8, 5]) → 5` (first: 4, last: 5, middle: 1)
- `max_of_three([9, 2, 6, 3, 7, 4, 5]) → 9` (first: 9, last: 5, middle: 6)
- `max_of_three([10]) → 10` (first: 10, last: 10, middle: 10)
- `max_of_three([2, 4, 1, 3, 7]) → 7` (first: 2, last: 7, middle: 1)
10 changes: 5 additions & 5 deletions list_1_indexing/plus-two/description.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Given two integer lists of arbitrary length, return a new list of length equal to the sum of the lengths of the two input lists, containing all the elements from both lists concatenated together.

For example:
- `plusTwo([1, 2], [3, 4]) → [1, 2, 3, 4]`
- `plusTwo([4, 4], [2, 2]) → [4, 4, 2, 2]`
- `plusTwo([9, 2], [3, 4]) → [9, 2, 3, 4]`
- `plusTwo([5], [6, 7, 8]) → [5, 6, 7, 8]`
- `plusTwo([], [1, 2, 3]) → [1, 2, 3]`
- `plus_two([1, 2], [3, 4]) → [1, 2, 3, 4]`
- `plus_two([4, 4], [2, 2]) → [4, 4, 2, 2]`
- `plus_two([9, 2], [3, 4]) → [9, 2, 3, 4]`
- `plus_two([5], [6, 7, 8]) → [5, 6, 7, 8]`
- `plus_two([], [1, 2, 3]) → [1, 2, 3]`
6 changes: 3 additions & 3 deletions list_1_indexing/return-middle-two/description.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Given a list of integers of even length, return a new list of length 2 containing the middle two elements from the original list. The original list will always be of length 2 or more.

For example:
- `middleTwo([1, 2, 3, 4]) → [2, 3]`
- `middleTwo([7, 1, 5, 9]) → [1, 5]`
- `middleTwo([5, 8]) → [5, 8]`
- `middle_two([1, 2, 3, 4]) → [2, 3]`
- `middle_two([7, 1, 5, 9]) → [1, 5]`
- `middle_two([5, 8]) → [5, 8]`
10 changes: 5 additions & 5 deletions list_1_indexing/swap-ends/description.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Given a list of integers, swap the first and last elements in the list. Return the modified list. The list will always have at least one element.

For example:
- `swapEnds([1, 2, 3, 4]) → [4, 2, 3, 1]`
- `swapEnds([1, 2, 3]) → [3, 2, 1]`
- `swapEnds([8, 6, 7, 9, 5]) → [5, 6, 7, 9, 8]`
- `swapEnds([10]) → [10]`
- `swapEnds([2, 4]) → [4, 2]`
- `swap_ends([1, 2, 3, 4]) → [4, 2, 3, 1]`
- `swap_ends([1, 2, 3]) → [3, 2, 1]`
- `swap_ends([8, 6, 7, 9, 5]) → [5, 6, 7, 9, 8]`
- `swap_ends([10]) → [10]`
- `swap_ends([2, 4]) → [4, 2]`
8 changes: 4 additions & 4 deletions list_2_iterating/basketball-stats/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Calculate how many total points they have, as well as their FG% (shots made / sh
Example: `"66.666%" = "66%"`
(Hint: `import math`, then use `math.floor()`)

Write a function `bball_stats(twos: int, threes: int, shotsTaken: int)` that takes three integer inputs, `twos`, `threes`, and `shotsTaken`.
Write a function `basketball_stats(twos: int, threes: int, shotsTaken: int)` that takes three integer inputs, `twos`, `threes`, and `shotsTaken`.

Return a list with an `int` and a `str`, where the `int` is their total amount of points and the `str` is the field goal percentage as a number with a percent.

Examples:

- `bball_stats(1, 1, 2) == [5, "100%"]`
- `basketball_stats(1, 1, 2) == [5, "100%"]`
1 two-pointer and 1 three-pointer = 5 points. The player took 2 shots, but also made 2 shots, so their FG% is 100%.

- `bball_stats(0, 0, 5) == [0, "0%"]`
- `basketball_stats(0, 0, 5) == [0, "0%"]`
0 two-pointers and 0 three-pointers = 0 points. The player took 5 shots, but made 0 shots, so their FG% is 0%.

- `bball_stats(2, 0, 3) == [4, "66%"]`
- `basketball_stats(2, 0, 3) == [4, "66%"]`
2 two-pointers and 0 three-pointers = 4 points. The player took 3 shots, but made 2 shots, so their FG% is 66%.
8 changes: 4 additions & 4 deletions list_2_iterating/exponential-list-check/description.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Given a list of integers, determine if each of the integers in the list is strictly bigger than the last. If so, return True, otherwise return False. The list will always be at least of length 2.

For example:
- `exponentialListCheck([1, 2, 3]) → True`
- `exponentialListCheck([2, 1, 5, 10, 9]) → False`
- `exponentialListCheck([10, 288, 300, 319]) → True`
- `exponentialListCheck([1, 1, 3]) → False`
- `exponential_list_check([1, 2, 3]) → True`
- `exponential_list_check([2, 1, 5, 10, 9]) → False`
- `exponential_list_check([10, 288, 300, 319]) → True`
- `exponential_list_check([1, 1, 3]) → False`
6 changes: 3 additions & 3 deletions list_2_iterating/list-splitter/description.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Given a list of integers and strings, return a list of only the strings.

For example:
- `elementArranger([1,”a”,3]) -> [“a”]`
- `elementArranger([“Hershey”,”c”,3,7,5]) -> [“Hershey”,"c"]`
- `elementArranger([10,20,36]) -> []`
- `list_splitter([1,”a”,3]) -> [“a”]`
- `list_splitter([“Hershey”,”c”,3,7,5]) -> [“Hershey”,"c"]`
- `list_splitter([10,20,36]) -> []`

Loading