Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 51s1 days 16 hours 1 minutes 51 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 51s1 days 16 hours 1 minutes 51 seconds.

Sign in to watch this lesson
Algorithms - Capstone · 5:29
A routine for a problem you have never seen: read the constraints to find the target complexity, write the obviously correct brute force, find its bottleneck and name the pattern that removes it, and check the edge cases before trusting anything. We run one problem, counting subarrays with sum k, through it four times: a triple loop, prefix sums, a one-pass hash map, and the shrinking window that negative numbers break. Then we time the three correct versions on a Mac.