Apple Interview Question

A normal graph problem usually taught in discrete math class