Citadel Securities Interview Question

A code question about number of paths