app.pebblelabs.dev/today
18:52 · window opens in 8 min
TUESDAY 12 AUGUST · YOUR WINDOW 19:00 — 20:00

Today's session is ready.

Four items, built from your last 14 windows. Nothing for you to pick.
Start — 60:00
warm
new problem · 25 min
review · 17 min
explain · 10 min
19:0019:2019:4020:00
01
Quick warm-upRECALL
five short prompts on last week's patterns
5 min
02
Sliding Window MaximumNEW · CODE
monotonic deque is your weakest pattern
25 min
03
Coin ChangeREVIEW · CODE
you stalled here 9 days ago
17 min
04
Search in Rotated ArrayEXPLAIN
due today · say it out loud, no editor
10 min
SHORT ON TIME? Cut the window to 30 minutes and Pebble re-plans instead of letting you skip a day. Shorten
app.pebblelabs.dev/session/solve
19:12 · 48 min left
NEW SLIDING WINDOW MEDIUM

Sliding Window Maximum

Given an array nums and a window size k, return the maximum of every contiguous window as it slides from left to right.

EXAMPLE nums = [1,3,-1,-3,5,3,6,7] k = 3 → [3,3,5,5,6,7]
HINTS each costs 2 min
? What must stay true about the window's contents?
🔒 Which structure removes the max in O(1)?
🔒 Full approach walkthrough
solution.py tests.py
python 3.12
1from collections import deque
2
3def max_sliding_window(nums, k):
4 dq, out = deque(), []
5
6 for i, n in enumerate(nums):
7 # drop indices outside the window
8 if dq and dq[0] <= i - k:
9 dq.popleft()
10
11 # keep the deque decreasing
12 while dq and nums[dq[-1]] < n:
13 dq.pop()
14
15 dq.append(i)
16 if i >= k - 1:
17 out.append(nums[dq[0]])
18
19 return out
TESTSCOMPLEXITYSCRATCHPAD
18 passed2 failed
✓basic window, k = 30.4ms
✓strictly decreasing input0.6ms
✗k == len(nums)index error, line 17
Run tests Submit & schedule review
app.pebblelabs.dev/session/explain
19:47 · 13 min left
EXPLAIN — NO EDITOR 4th review · last solved 12 days ago

Search in Rotated Sorted Array

SOLVE IT OUT LOUD Walk me through how you'd find the target in this array. What do you look at first, and what do you do with what you find?
nums = [6,7,8,1,2,3,4,5] target = 3
JOT YOUR PLAN FIRST (OPTIONAL) not graded
mid = index 3 → value 1
left 6,7,8 is sorted. 3 not in 6..8 → go right▌
WHAT YOU SAID
YOU

I'd keep two pointers and look at the middle, index 3, which is 1. Left of it is 6,7,8 — climbing, so the left side is the clean sorted part.

spoken · 38sapproach ✓
YOU

Target is 3. The sorted left runs 6 to 8, so 3 can't be there — throw that half away, search from index 3. Then mid is 3. Two steps.

spoken · 31swalkthrough ✓
PB

Nice. Same array, but target is 7 — say the next two steps out loud.

follow-upnudge 1 of 1
●
01:48 Done
hold space to talk · type instead · ⌘↵ to finish
app.pebblelabs.dev/session/summary
19:58 · window closed
TUESDAY · 19:00 — 19:58

You finished the whole window.

4 problems, 2 explained out loud. One pattern out of the danger zone.
58mIN WINDOW
4PROBLEMS
2EXPLAINED
+3READINESS
HOW THE HOUR WENT
1
Quick warm-up 4m 20s
5 of 5 recalled
2
Sliding Window Maximum 26m 10s
solved · 1 hint · 5 min over your median
3
Coin Change 16m 40s
solved clean · 6 min faster than last time
4
Rotated Array — explained 10m 50s
4 of 5 covered · 1 nudge
WHAT MOVED TODAY
Sliding window
12 → 34
Dynamic programming
41 → 58
Binary search
58 → 81
Backtracking
37 → 35
this morning gained today slipped
71 OF 100
INTERVIEW READINESS Up 3 this week. Keep your window and you cross 80 in about nine days.
CONSISTENCY
13 of the last 14 windows kept.
TOMORROW, ALREADY PLANNED
Monotonic Stack — new code
Sliding Window Maximum explain
Backtracking: Subsets code
Close session