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

Sign in to watch this lesson
Advanced - Combinatorics, Games and Puzzles · 4:41
Four operations on balanced bracket sequences, all in linear time after one quadratic table. A depth counter (or a stack, when there are several kinds of bracket) checks a sequence, the next sequence in sorted order flips the rightmost opening bracket that still has something open to its left and refills the rest, and a table of ways to finish turns a sequence into its rank and a rank back into a sequence. We also see why those counts need 64-bit and then 128-bit integers.