Closed kkandukuri closed 2 years ago
Hi @kkandukuri , Thank you for reaching out. Could you please provide more details on your missing test case report. The test case and the code that you've used for submission.
Hi @LC-Sue, It appears as though @kkandukuri has intended to convey what I also came here to file a report about, which is that in this question the description states "You must implement an algorithm that runs in O(n) time and uses constant extra space." In Java (as well as Python which is what I was using) the sort() method's algorithm uses Timsort which has a time complexity of O( n log(n) ) which is not linear time. The fact that the code above works and indeed most all of the top accepted solutions I saw used sort() means that the expected behavior of the problem is not being met as non-linear solutions should be rejected.
Hi @JLozensky, Thank you for the clarification, I have relayed this issue over to our team to investigate.
Hi @kkandukuri @JLozensky Thank you for your time, our team has looked into the problem. We know that nlogn can pass and there is no way to fail this complexity. nlogn is fast and good but in the interview, you are asked to find an O(n) solution.
Your LeetCode username
Category of the bug
Description of the bug
Code you used for Submit/Run operation
Language used for code
JAVA
Expected behavior
Screenshots
Additional context