Detail Form
We will send your result on your email id and phone no. please fill detail
You are given an array arr[], you have to re-construct an array arr[].
The values in arr[] are obtained by doing Xor of consecutive elements in the array.
Example 1:
Example 2:
Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function game_with_number() that takes an array (arr), sizeOfArray (n), and return the array re-constructed array arr. The driver code takes care of the printing.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).
Constraints:
1 ≤ N ≤ 105
1 ≤ arr[i] ≤ 107
Given two integers a and b. Find the sum of two numbers without using arithmetic operators.
Example 1:
Example 2:
You are given an array arr[], you have to re-construct an array arr[].
The values in arr[] are obtained by doing OR(bitwise or) of consecutive elements in the array.
Example 1:
Example 2:
Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function game_with_number() that takes an array (arr), sizeOfArray (n), and return the array re-constructed array arr. The driver code takes care of the printing.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(1).
Constraints:
1 ≤ N ≤ 105
1 ≤ arr[i] ≤ 107
Given a positive integer N, print count of set bits in it.
Example 1:
Example 2:
Your Task:
You don't need to read input or print anything. Your task is to complete the function setBits() which takes an Integer N and returns the count of number of set bits.
Expected Time Complexity: O(LogN)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ N ≤ 109
There are N students in a class. Each student got arr[i] (1 <= i <= N) marks in mathematics exam. Geek loves mathematics, so, he wanted to solve the questions. And he got X marks. And now geek is curious to know, how many students are there in the class who got marks greater than geek's
Input:
1. The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
2. The first line of each test case contains two space-separated integers N and X.
3. The second line contains N space-separated positive integers represents array arr.
Output: For each test case, print the count of students who got marks greater than X.
Constraints:
1. 1 <= T <= 10
2. 1 <= N <= 100000
3. 1 <= arr[i], K <= 100000
Example: