Loading lesson…
Level 1 · Apprentice0 XP
Let a single item and a group of items answer the same questions.
Step 1 / 5
ProblemCode that computes disk usage checks: if it is a file, take its size, if it is a folder, loop over children, and if a child is a folder, loop again. Every feature repeats the same type checks and nested loops.
← → step
Before this: Proxy: a stand-in with the same face
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Model a price rule that is either a single condition (minimum basket, member only) or a group of rules joined by ALL or ANY. Give every rule one method: applies(basket). Build a nested rule and evaluate it.