In my next solution, I just took an integer variable count and incremented it every time k occurred while traversing the array a. 이 공간 복잡성은 O로 줄어들고 시간 복잡성은 여전히 켜져 있습니다. He told me that if the array is sorted and now I have to reduce the time complexity as well.