# | Time Complexity | Space Complexity | Description | Submission | Runtime (4 trials) | Memory (4 trials) |
---|---|---|---|---|---|---|
1 | O(n^2) | O(1) | Iterate through the array and remove the element if it matches the target. | Link | 47.75 ms | 16.45 MB |
2 | O(n) | O(1) | Iterate through the array and overwrite first k elements that are not a match | Link | 39.75 ms | 16.3 MB |