Company: Visa_6nov
Difficulty: medium
Pivot Count Comparison Problem Description You are given an array of integers numbers and an integer pivot . Let countGreater denote how many integers within numbers are strictly greater than pivot , and countLess denote how many integers are strictly less than pivot . Your task is to compute countGreater and countLess , then return: "greater" if countGreater is greater than countLess ; "smaller" if countGreater is less than countLess ; "tie" if they are equal. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O( numbers.length ) will fit within the execution time limit. Examples Example 1: Input: numbers = [1, 3, 0, -1, 4, 3], pivot = 2 Output: "smaller" Explanation: There are countGreater = 3 Integers greater than pivot = 2 : numbers[1] = 3 , numbers[5] = 4 , and numbers[6] = 3 ; There are countLess = 4 Integers smaller than pivot = 2 : numbers[0] = 1 , numbers[2] = 0 , numbers[3] = -1 , and numbers[4] = 1 ; Therefore,