Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 690aa76

Browse files
committed
Small touch-ups to prob.md in donuts and potoroo
1 parent 91c2d45 commit 690aa76

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

competition/donuts/prob.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ points = 20
1111
difficulty = 2
1212
---
1313

14-
## 🍩 Homer's Donut Run
14+
# 🍩 Homer's Donut Run
1515

1616
Homer Simpson is on a mission to visit a series of **Krispy Kreme** locations arranged in a circle. Each Krispy Kreme offers a certain number of **donuts** for him to collect. However, running between locations costs him some of his precious supply, as Homer **eats donuts for energy while running**. If he runs out of donuts at any point, he'll **collapse** from exhaustion.
1717

@@ -26,7 +26,20 @@ Your task is to pinpoint the **starting Krispy Kreme's index** that allows Homer
2626

2727
Rest assured, there's at most one valid starting point.
2828

29-
**Example 1:**
29+
## Input
30+
31+
The input prompt for this question will be 10 rows of numbers,
32+
representing 5 test cases.
33+
In each pair of lines of the input prompt,
34+
the first line in the pair represents the number of donuts at each house,
35+
while the second line in the pair represents the cost of journeying out of the respective house.
36+
37+
### Constraints:
38+
39+
* `1 <= donuts.length == cost.length <= 1000`
40+
* `0 <= donuts[i], cost[i] <= 1000`
41+
42+
### Example 1:
3043

3144
Input: `donuts = [1,2,3,4]`, `cost = [2,2,4,1]`
3245
Output: `3`
@@ -39,7 +52,7 @@ Explanation: If Homer starts at Krispy Kreme 3 (index 3) and grabs 4 donuts:
3952
* Runs to Krispy Kreme 3, eating 4 donuts. His stomach: 5 - 4 + 4 (from station 3) = 5 donuts.
4053
Homer makes it back to his starting point with donuts to spare, successfully avoiding a collapse!
4154

42-
**Example 2:**
55+
### Example 2:
4356

4457
Input: `donuts = [1,2,3]`, `cost = [2,3,2]`
4558
Output: `-1`
@@ -49,8 +62,3 @@ Homer can't start at Krispy Kreme 0 or 1, because he wouldn't have enough donuts
4962
If he starts at Krispy Kreme 2, he can run to Krispy Kreme 0, and then Krispy Kreme 1.
5063
At Krispy Kreme 1, his stomach: 0 + 3 (from station 2) - 2 (eaten to 0) + 1 (from station 0) - 2 (eaten to 1) = 0 donuts.
5164
He's now stuck at Krispy Kreme 1 with an empty stomach. Without any donuts to power him, he'll collapse right there and won't complete the circuit. D'oh!
52-
53-
**Constraints:**
54-
55-
* `1 <= donuts.length == cost.length <= 1000`
56-
* `0 <= donuts[i], cost[i] <= 1000`

competition/potoroo/prob.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,17 @@ A single integer representing the minimum number of tasty bush snacks you need t
3535

3636
## Example
3737

38-
**Input:**
38+
### Input
3939
```
40-
4140
1 0 2
42-
4341
```
4442

45-
**Output:**
43+
### Output
4644
```
47-
4845
5
49-
5046
```
5147

52-
**Explanation:**
48+
### Explanation
5349

5450
You can distribute the snacks as follows:
5551
- Potoroo 1 (activity 1): 2 snacks
@@ -61,4 +57,4 @@ This distribution satisfies all the conditions:
6157
- Potoroo 1 (activity 1) has more snacks than its neighbor, Potoroo 2 (activity 0).
6258
- Potoroo 3 (activity 2) has more snacks than its neighbor, Potoroo 2 (activity 0).
6359

64-
The total number of snacks is `2 + 1 + 2 = 5`.
60+
The total number of snacks is `2 + 1 + 2 = 5`.

0 commit comments

Comments
 (0)