OA: Count Paths Through Four Shop Types

Medium · Coding · 45 min

Count ordered simple paths of shops in an undirected road network that visit each required shop category (A, B, C, D) once in either direction, then generalize to k categories on dense graphs via bitmask DP.

This is a Pro problem. Pro unlocks the full prompt, a step-by-step walkthrough, a reference solution and tests you can run.

See Pro plans

More OpenAI problems