Algorithm · Capital One · Hard
The tasks below are independent. For each one, implement a function that returns the described result. All arrays and lists use zero-based indexing. Strings contain only ASCII letters and spaces unless a task explicitly says otherwise. Aim for efficient time complexity, ideally $$O(n \log n)$$ or better when possible. 1. Compare counts above and below a target Given an integer target and an integer array arr, count how many elements in arr are strictly greater than target…
Checking your access…