-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Description
Bug Report for https://neetcode.io/problems/insert-new-interval
The recommended space complexity is O(1), which is possible if the intervals list supports adding new elements without (necessarily) resizing. But C# arrays are fixed-size. So since it's possible that an interval will be added to the list, we can't guarantee that all intervals will fit within the original size. Rather, a new array might have to be created with n+1 size.
I suggest that the recommended space be changed to O(n).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels