Let’s discuss anything related to the SPIRAL MATRIX problem in this thread.
What are perf-tests
They are performance tests with larger input.
But only one best time complexity is O(m*n) and I am using that.
It may not be failing because of TLE.
Try to check if your implementation works for a 5*5 matrix or larger.
My Code did not work for 5*5. I modified it and then it worked and then I got cleared all test cases.
Hint: Consider cases such as single row and single column. Does your code handle these correctly?
thanks it solved my issue
Base test-3 and perf test-3 are failed during assignment. Tried for 2 hours but not able to solve it.
Tested with large inputs, it worked.Please help
This is a O(n*m) complexity question. Try matrices having different n and m. it might help ti identify wrong cases.
Try to decrease the complexity and remove uncertain steps.