3 ms·
You don't have to assume that. We can take each randomly oriented noodle and orient it correctly in O(1) as a preprocessing step. Since the complexity would be
by AlotOfReading 3mo ago
You don't have to assume that. We can take each randomly oriented noodle and orient it correctly in O(1) as a preprocessing step. Since the complexity would be additive, the overall complexity remains O(N).