Company: Barclays
Difficulty: medium
Number of Elements Less Than K Programming Language: C++14 (GCC 5.5.0) You are given a list of integers and an integer K. Write an algorithm to find the number of elements in the list that are strictly less than K. Note: You can use cout to debug your code. The code may not work in case of syntax/runtime error. Input Format The first line of the input consists of an integer - element_size , representing the number of elements in the list (N). The second line consists of N space-separated integers - element[1], element[2], ..., element[N] , representing the list of integers. The last line consists of an integer - num , representing the integer to be compared (K). Output Format Print a positive integer representing the number of elements in the list that are strictly less than num . Constraints 10 2 ≤ num ≤ 10 9 10 2 ≤ element[1], element[2], ......., element[N] ≤ 10 9 Example Input: 7 1 7 4 5 6 3 2 5 Output: 4 Explanation: The numbers that are less than 5 are 1,2,3,4. So, the output is