Your concept feed

39 ideas

A few small steps. No rush.

Follow the connections in this topic

Let’s picture it

Same square. Different tickets.

square + 1 ticket
square + 0 tickets

A wall is ahead. One traveler has a wall-removal ticket; the other has none.

Swipe when you’re ready
One little change

Keep their answers separate.

row
column
tickets left

The first traveler may pass. The second may be stuck. Row and column alone lose that difference.

Same idea. One more small step.
Now it has a name

That’s a third state label.

place in row
place in column
budget

3D DP isn’t strange geometry. It means three pieces of information identify the smaller question.

Want to try a tiny question?
No pressure. Just try it.

Which label distinguishes these two travelers?

You can also keep scrolling
1 / 4
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Same door. One small difference.

You + key
Locked door

You have a key. Your friend doesn’t. The door is the same, but your next move isn’t.

1 / 3
A familiar idea

Remember the wall-removal ticket?

same grid
new movement rule
new objective

Now moves can go up, down, left, or right. We want the fewest steps, not the number of routes.

Swipe when you’re ready
One new wrinkle

Two arrivals are not always equivalent.

square + 0
square + 1

At the same square, one traveler has no tickets left. Another has one and can pass a wall ahead.

Same idea. One more small step.
Try a tiny example

Keep the ticket in the visited key.

row
column
tickets left

Use (row, column, remaining tickets). Spending a ticket moves to a different state, even at a familiar location.

Same idea. One more small step.
Notice what matters

Choose BFS because each move costs one.

0 moves
1 move
2 moves

The first reached goal state has the fewest steps. The queue handles cycles; a right/down table order no longer does.

Same idea. One more small step.
Make it reusable

Extra state does not force a DP table.

what to remember
how to explore

State design and exploration order are separate choices. Here the correct combination is a three-coordinate state explored with BFS.

Want to try a tiny question?
No pressure. Just try it.

Can we reject every second arrival at the same square?

You can also keep scrolling
1 / 6
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Same square. Different tickets.

square + 1 ticket
square + 0 tickets

A wall is ahead. One traveler has a wall-removal ticket; the other has none.

1 / 3
Let’s picture it

Two travelers move down together.

row: 1
left: 0
right: 2

Both are on the same row. One is in column 0; the other is in column 2.

Swipe when you’re ready
One little change

We don’t need two row labels.

row
column A
column B

Their row is shared. Store it once, plus one column for each traveler.

Same idea. One more small step.
Now it has a name

Three labels can describe two people.

same cell
one reward

Count independent information, not characters. If both collect from the same cell, count that cell’s reward once.

Want to try a tiny question?
No pressure. Just try it.

Do we need four position labels when both always share a row?

You can also keep scrolling
1 / 4
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Same square. Different tickets.

square + 1 ticket
square + 0 tickets

A wall is ahead. One traveler has a wall-removal ticket; the other has none.

1 / 3
Let’s picture it

Do we still need yesterday’s notes?

older rows
yesterday
today

Suppose today’s row only reads yesterday’s row. Rows before yesterday will never be used again.

Swipe when you’re ready
One little change

Keep two rows, then swap.

previous
current

Finish the new row. It becomes the previous row for the next step.

Same idea. One more small step.
Now it has a name

Less storage, same questions.

keep what is read
discard what isn’t

Space compression removes answers we won’t read again. It does not remove information the next calculation still needs.

Want to try a tiny question?
No pressure. Just try it.

Can we overwrite an old value before its last reader uses it?

You can also keep scrolling
1 / 4
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Two ways to fill a notebook.

asked?
solve once
save

One way: when a question appears, solve it if needed, then write down the answer.

1 / 3
A familiar idea

Give three places their own switches.

C: 0
B: 0
A: 0

Rightmost is A, middle is B, leftmost is C. A lit bit means that place has been visited.

Swipe when you’re ready
One new wrinkle

Visit A, then C.

001
101

Turn on A’s bit: 001. Then C’s bit: 101. The same places in another order produce the same mask.

Same idea. One more small step.
Try a tiny example

Use OR to turn a bit on.

mask
single bit
OR combines

1 << v makes a single lit bit at position v. mask | (1 << v) includes that place without switching other bits off.

Same idea. One more small step.
Notice what matters

Use AND to ask whether it is on.

membership: &
include: |
all: 111

mask & (1 << v) is nonzero exactly when v is included. All three places visited gives 111.

Same idea. One more small step.
Make it reusable

Small notation. Still many possible sets.

3 bits
8 subsets

Three bits allow eight masks. n bits allow 2ⁿ. A compact representation does not make every subset search cheap.

Want to try a tiny question?
No pressure. Just try it.

Does 101 remember whether A or C was visited first?

You can also keep scrolling
1 / 6
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Have we visited the park?

Home ✓
Park ✓

Keep a little checklist of places we’ve seen.

1 / 3
Let’s picture it

Which towns are still unvisited?

visited: A,C
visited: B,C

Two travelers stand at C. One has visited A; the other has visited B. Their remaining tasks differ.

Swipe when you’re ready
One little change

Keep a tiny checklist.

A: 1
B: 0
C: 1

For A, B, C, the bits 1, 0, 1 mean A and C have been visited.

Same idea. One more small step.
Now it has a name

The chosen set can be state.

which items?
where now?

Subset DP remembers which items are included, often alongside a current position. n yes/no choices give 2ⁿ possible subsets.

Want to try a tiny question?
No pressure. Just try it.

Does a compact bitmask make the number of possible subsets small?

You can also keep scrolling
1 / 4
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

We’ve answered this before.

route A
3 stairs left
route B

Two routes leave us with three stairs left. We may climb one or two at a time.

1 / 3
A familiar idea

Visit every leaf of a little star.

center
three leaves

A center connects three leaves. You may start anywhere and revisit nodes. Find the shortest walk covering all four.

Swipe when you’re ready
One new wrinkle

The center must be visited again.

leaf A
center
leaf B
center
leaf C

Start at one leaf: leaf → center → leaf → center → last leaf. That is four moves.

Same idea. One more small step.
Try a tiny example

Same center. More places collected.

center + {A}
center + {A,B}

At the center with only A visited, B and C remain. After visiting B, the remaining task is different.

Same idea. One more small step.
Notice what matters

Pair the node with its visited mask.

current node
visited mask

A bit per node remembers the set. Revisiting the center is allowed; rediscovering the identical node-and-mask state is unnecessary.

Same idea. One more small step.
Make it reusable

Put every starting node into BFS.

all starts
BFS states
all bits on

Each start has distance zero and its own one-bit mask. Stop at the first state whose mask contains every node.

Same idea. One more small step.
Name the idea

Graph search meets subset state.

revisit allowed
same mask possible
queue order

Unlike exactly-once subset DP, some moves add no new bit. BFS handles those cycles because every move still costs one.

Want to try a tiny question?
No pressure. Just try it.

Why not mark the center visited forever after its first arrival?

You can also keep scrolling
1 / 7
Extra state & 3D DP

One small step at a time.

This idea builds on these smaller ones. Pick any to revisit it here.

Which towns are still unvisited?

visited: A,C
visited: B,C

Two travelers stand at C. One has visited A; the other has visited B. Their remaining tasks differ.

1 / 3
You've reached the end of these ideas.Try them without the labels