Refactor tests to use property-based testing
Current tests rely on user input or pre-defined sizes. There might be coverage gaps or corner cases that are not dealt with. Generating batch of tests using property-based frameworks might help solve the issue.