This is a verified interview question from Barclays. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Count Elements Less Than K - Barclays Online Assessment NIT Bhopal" covers key patterns like Arrays.
"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$. **Input** 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** Print a positive integer representing the number of elements in the list that are strictly less than *num*. **Example** Input: 7 1 7 4 5 6 3 2 5 Output: 4 Explanation: The numbers that are less than 5Here is the exact problem statement transcribed directly from the image:"
Join thousands of developers practicing for Barclays.