Company: oracle_9aug
Difficulty: medium
Valid keys Problem Description A cyber security firm has discovered a new type of encryption being used by a group of hackers. The encryption key will be a valid key, which is a number that has exactly 3 factors for divisors. For example, 4 is a valid key because it has exactly 3 factors: 1, 2, and 4. But 6 is not a valid key because it has 4 factors: 1, 2, 3, and 6. Given an array `keys` of length `n`, find the number of valid keys in the range `[1, keys[i]]` both inclusive, for each `0 Note: `a` is called a divisor of `b` if there is an integer `c` such that `a * c = b`. Only positive integers are taken into account for counting divisors. Function Description Complete the function `getValidKeyCount` in the editor below. `getValidKeyCount` has the following parameter: `vector keys`: an array of integers. Returns: `vector `: an array of integers containing the answer for each query. Examples Example 1: Input: n = 2, keys = [5, 11] Output: [1, 2] Explanation: For `keys[0] = 5`, the only