Company: oracle_9aug
Difficulty: medium
Valid Keys Problem Description A cyber security firm has found a new kind of encryption used by a group of hackers. Every encryption key they use is a valid key : a positive integer that has exactly 3 positive divisors. For example, 4 is a valid key because its divisors are 1 , 2 and 4 . The number 6 is not a valid key because it has 4 divisors: 1 , 2 , 3 and 6 . You are given n queries keys[0], keys[1], ..., keys[n-1] . For each query, find how many valid keys lie in the inclusive range [1, keys[i]] . Complete the function getValidKeyCount , which receives the array keys and returns an array whose i -th value is the answer for keys[i] . Input Format Read from standard input. n keys[0] keys[1] ... keys[n-1] Line 1 contains the integer n , the number of queries. Each of the next n lines contains one integer keys[i] . Output Format Print n lines. Line i contains the number of valid keys in the range [1, keys[i]] , in the same order as the queries. Constraints 1 <= n <= 2000 . (infe