Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a 2D screen, you are given the location of a pixel in the screen i.e. (x, y) and a color(K), your task is to replace color of the given pixel at (x, y) and all pixels connected to it with the given color K.
Two pixels are connected if these conditions satisfy:
1. They both must have same co... | Compilable |
For this Question: Given a 2D screen, you are given the location of a pixel in the screen i.e. (x, y) and a color(K), your task is to replace color of the given pixel at (x, y) and all pixels connected to it with the given color K.
Two pixels are connected if these conditions satisfy:
1. They both must have same co... | Compilable |
For this Question: Given a binary tree with root 1. You have to make some other node as the root such that all conditions of a binary tree is satisfied. Print all nodes other than 1 that can be made as the root of the tree in sorted order.
Note - You cannot add/remove a node. You cannot break any edge.First line conta... | Compilable |
For this Question: Given a binary tree with root 1. You have to make some other node as the root such that all conditions of a binary tree is satisfied. Print all nodes other than 1 that can be made as the root of the tree in sorted order.
Note - You cannot add/remove a node. You cannot break any edge.First line conta... | Compilable |
For this Question: Given a binary tree with root 1. You have to make some other node as the root such that all conditions of a binary tree is satisfied. Print all nodes other than 1 that can be made as the root of the tree in sorted order.
Note - You cannot add/remove a node. You cannot break any edge.First line conta... | Compilable |
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: For an integer N, your task is to calculate sum of first N natural numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to worry about input. You just have to complete the function <b>sum()</b> which takes the integer N as a parameter.
Constraints:
1 <= N < = 1000000... | Compilable |
For this Question: Given three integers A, B and C. Your task is to calculate the number of integers which are factors of atleast two given numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>CommonFactors()</b> that takes the integ... | Compilable |
For this Question: Given three integers A, B and C. Your task is to calculate the number of integers which are factors of atleast two given numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>CommonFactors()</b> that takes the integ... | Compilable |
For this Question: Given three integers A, B and C. Your task is to calculate the number of integers which are factors of atleast two given numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>CommonFactors()</b> that takes the integ... | Compilable |
For this Question: Given three integers A, B and C. Your task is to calculate the number of integers which are factors of atleast two given numbers.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>CommonFactors()</b> that takes the integ... | Compilable |
For this Question: Ready for a super simple challenge!
You are given two integers A and B. You will create a line of boys and girls in the following manner:
First A girls, then B boys, then A girls, then B boys, and so on.
You will also be given an integer N. Find the number of girls in the first N people of the row... | Compilable |
For this Question: Ready for a super simple challenge!
You are given two integers A and B. You will create a line of boys and girls in the following manner:
First A girls, then B boys, then A girls, then B boys, and so on.
You will also be given an integer N. Find the number of girls in the first N people of the row... | Compilable |
For this Question: Ready for a super simple challenge!
You are given two integers A and B. You will create a line of boys and girls in the following manner:
First A girls, then B boys, then A girls, then B boys, and so on.
You will also be given an integer N. Find the number of girls in the first N people of the row... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given two strings Str1 and Str2 your task is to print the concatenation of the given two strings.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>StringConcatenation()</b> that takes the string Str1 and Str2 as input.
... | Compilable |
For this Question: Given two strings Str1 and Str2 your task is to print the concatenation of the given two strings.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>StringConcatenation()</b> that takes the string Str1 and Str2 as input.
... | Compilable |
For this Question: Given two strings Str1 and Str2 your task is to print the concatenation of the given two strings.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>StringConcatenation()</b> that takes the string Str1 and Str2 as input.
... | Compilable |
For this Question: Given a matrix of size N*N, your task is to find the sum of the primary and secondary diagonal of the matrix.
For Matrix:-
M<sub>00</sub> M<sub>01</sub> M<sub>02</sub>
M<sub>10</sub> M<sub>11</sub> M<sub>12</sub>
M<sub>20</sub> M<sub>21</sub> M<sub>22</sub>
Primary diagonal:- M<sub>00</sub> ... | Compilable |
For this Question: Given a matrix of size N*N, your task is to find the sum of the primary and secondary diagonal of the matrix.
For Matrix:-
M<sub>00</sub> M<sub>01</sub> M<sub>02</sub>
M<sub>10</sub> M<sub>11</sub> M<sub>12</sub>
M<sub>20</sub> M<sub>21</sub> M<sub>22</sub>
Primary diagonal:- M<sub>00</sub> ... | Compilable |
For this Question: Given a matrix of size N*N, your task is to find the sum of the primary and secondary diagonal of the matrix.
For Matrix:-
M<sub>00</sub> M<sub>01</sub> M<sub>02</sub>
M<sub>10</sub> M<sub>11</sub> M<sub>12</sub>
M<sub>20</sub> M<sub>21</sub> M<sub>22</sub>
Primary diagonal:- M<sub>00</sub> ... | Compilable |
For this Question: Given a matrix of size N*N, your task is to find the sum of the primary and secondary diagonal of the matrix.
For Matrix:-
M<sub>00</sub> M<sub>01</sub> M<sub>02</sub>
M<sub>10</sub> M<sub>11</sub> M<sub>12</sub>
M<sub>20</sub> M<sub>21</sub> M<sub>22</sub>
Primary diagonal:- M<sub>00</sub> ... | Compilable |
For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her.
In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N.
Here, d(M) refers to the sum of a... | Compilable |
For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her.
In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N.
Here, d(M) refers to the sum of a... | Compilable |
For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her.
In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N.
Here, d(M) refers to the sum of a... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: You are given two arrays - value and frequency both containing N elements.
There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times.
Finally you have to tel... | Compilable |
For this Question: You are given two arrays - value and frequency both containing N elements.
There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times.
Finally you have to tel... | Compilable |
For this Question: You are given two arrays - value and frequency both containing N elements.
There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times.
Finally you have to tel... | Compilable |
For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: Given an integer n, For each i from 1 to N if i is even print "<b>even</b>" else print "<b>odd</b>".<b>User task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the functions <b>For_Loop()</b> that takes the integer n as parameter.
</b>Constra... | Compilable |
For this Question: Given an array A of size N. <b>Value</b> of an element A<sub>i</sub> is defined as the sum of the absolute difference of all elements of the array with A<sub>i</sub>. More formally, the value of an element at index i is the sum of |A<sub>i</sub> - A<sub>j</sub>| over all j (1 <= j <= N). Find the max... | Compilable |
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix.
Constraints:-
1 <=... | Compilable |
For this Question: Given a string S you have to remove all pairs of identical letters, which are consecutive. If after the removal there appear new pairs, remove them as well. Repeat this untill no adjacent letter in the string is same.
Note that deleting of the consecutive identical letters can be done in any order, ... | Compilable |
For this Question: Given a string S you have to remove all pairs of identical letters, which are consecutive. If after the removal there appear new pairs, remove them as well. Repeat this untill no adjacent letter in the string is same.
Note that deleting of the consecutive identical letters can be done in any order, ... | Compilable |
For this Question: Given a string S you have to remove all pairs of identical letters, which are consecutive. If after the removal there appear new pairs, remove them as well. Repeat this untill no adjacent letter in the string is same.
Note that deleting of the consecutive identical letters can be done in any order, ... | Compilable |
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n
Constraints:-
0 <= n <= 20Output is a single line containing factorial(n)Sample Input
5
Sample Output
120
Explanation:-
5!= 5 * 4 * 3 * 2 * 1 = 120
Sample Input
10
... | Compilable |
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n
Constraints:-
0 <= n <= 20Output is a single line containing factorial(n)Sample Input
5
Sample Output
120
Explanation:-
5!= 5 * 4 * 3 * 2 * 1 = 120
Sample Input
10
... | Compilable |
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n
Constraints:-
0 <= n <= 20Output is a single line containing factorial(n)Sample Input
5
Sample Output
120
Explanation:-
5!= 5 * 4 * 3 * 2 * 1 = 120
Sample Input
10
... | Compilable |
For this Question: Chef has a garden of size N x N. The garden is divided into N<sup>2</sup> squares of size 1 x 1 each. Chef has plants in some unit squares of the garden, because of which, that part looks green. Formally, for the i<sup>th</sup> row (0 ≤ i < N), Chef has plants in all the columns from A<sub>i</sub>... | Compilable |
For this Question: Given an integer n holding some random value, your task is to assign value 10 to the given integer.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b>Assignment_Operator()</b>, which takes no parameter.
<b>Constraints:<... | Compilable |
For this Question: Given a Binary Search Tree and 2 node value <b>n1</b> and <b>n2</b>, your task is to find the <b>lowest common ancestor(LCA)</b> of the two nodes given.
It may happen that values n1 and n2 may or may be not present.
<b>Note:</b> Duplicates are not inserted in the BST.<b>User Task:</b>
This is a ... | Compilable |
For this Question: Newton is forced to solve a puzzle given by his friend Ramanujan. In the puzzle Newton is given N non-negative integers T<sub>1</sub>, T<sub>2</sub>, ... T<sub>N</sub>, and another positive integer X. Now, Newton has to choose an integer Z between 0 and X, such that the function f(Z) = (Z xor T<sub>1... | Compilable |
For this Question: We have N+M balls, each of which has an integer written on it.
It is known that:
1) The numbers written on the N of the balls are even.
2) The numbers written on the M of the balls are odd.
Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the number... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80.
Your task is to find out Alice's power after N seconds.The input consists of a single li... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it.
First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum... | Compilable |
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it.
First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum... | Compilable |
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it.
First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum... | Compilable |
For this Question: Sara wants to be the best programmer in the world but today she is stuck on an easy problem. Help her to solve it.
<b>Problem description:- </b>
Choose an integer N and subtract the sum of digits of the number N from it i. e. if N is 245 then subtract 2+4+5 from it making it 245 - 11 = 234.
Kee... | Compilable |
For this Question: Sara wants to be the best programmer in the world but today she is stuck on an easy problem. Help her to solve it.
<b>Problem description:- </b>
Choose an integer N and subtract the sum of digits of the number N from it i. e. if N is 245 then subtract 2+4+5 from it making it 245 - 11 = 234.
Kee... | Compilable |
For this Question: Sara wants to be the best programmer in the world but today she is stuck on an easy problem. Help her to solve it.
<b>Problem description:- </b>
Choose an integer N and subtract the sum of digits of the number N from it i. e. if N is 245 then subtract 2+4+5 from it making it 245 - 11 = 234.
Kee... | Compilable |
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well).
Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y... | Compilable |
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well).
Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y... | Compilable |
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well).
Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y... | Compilable |
For this Question: Sky (the blue ranger) wants to replace Jack (the red ranger) from his position. For this, he needs to conquer the entire Base.
The Base can be represented as an M*N grid, and Sky needs to conquer it cell by cell. Sky starts conquering the Base from the cell (1, 1). In each move, he conquers the cell... | Compilable |
For this Question: Sky (the blue ranger) wants to replace Jack (the red ranger) from his position. For this, he needs to conquer the entire Base.
The Base can be represented as an M*N grid, and Sky needs to conquer it cell by cell. Sky starts conquering the Base from the cell (1, 1). In each move, he conquers the cell... | Compilable |
For this Question: Sky (the blue ranger) wants to replace Jack (the red ranger) from his position. For this, he needs to conquer the entire Base.
The Base can be represented as an M*N grid, and Sky needs to conquer it cell by cell. Sky starts conquering the Base from the cell (1, 1). In each move, he conquers the cell... | Compilable |
For this Question: N+1 towns are going to be attacked by monsters. The i-th town will be attacked by Ai monsters. Saloni has got N of her friends for rescue. The i-th friend has the capability to kill at most Bi monsters. The only constraint is that the i-th friend can kill monsters from town i and i+1 only.
Find the ... | Compilable |
For this Question: N+1 towns are going to be attacked by monsters. The i-th town will be attacked by Ai monsters. Saloni has got N of her friends for rescue. The i-th friend has the capability to kill at most Bi monsters. The only constraint is that the i-th friend can kill monsters from town i and i+1 only.
Find the ... | Compilable |
For this Question: N+1 towns are going to be attacked by monsters. The i-th town will be attacked by Ai monsters. Saloni has got N of her friends for rescue. The i-th friend has the capability to kill at most Bi monsters. The only constraint is that the i-th friend can kill monsters from town i and i+1 only.
Find the ... | Compilable |
For this Question: Complete the function <code>solve</code> which takes <code>obj</code> as a parameter which is an <code>object</code>.
Iterate <code>obj</code> using a <code>for of</code> and a <code>for in</code> loop. The <code>for...of</code> loop should print all the <code>values</code> of the <code>obj</code>... | Compilable |
For this Question: Siddharth, a great entrepreneur, chooses a person as an intern if he/she good at maths. Thus Sid gives a simple maths problem to the candidate based on which he decides to who is gonna get the offer. Below is the description of the problem asked by Sid
Given arr <b>A[]</b> containing <b>N</b> positi... | Compilable |
For this Question: Siddharth, a great entrepreneur, chooses a person as an intern if he/she good at maths. Thus Sid gives a simple maths problem to the candidate based on which he decides to who is gonna get the offer. Below is the description of the problem asked by Sid
Given arr <b>A[]</b> containing <b>N</b> positi... | Compilable |
For this Question: Siddharth, a great entrepreneur, chooses a person as an intern if he/she good at maths. Thus Sid gives a simple maths problem to the candidate based on which he decides to who is gonna get the offer. Below is the description of the problem asked by Sid
Given arr <b>A[]</b> containing <b>N</b> positi... | Compilable |
For this Question: You are given N flags, initially set to 0. Now you have to perform two operations on them:
1. Increase(F) by 1: flag F is increased by 1.
2. max_flag: all flags are set to a maximum value of any flag.
A non-empty array arr[] will be given of size M. This array represents consecutive operations:
... | Compilable |
For this Question: You are given N flags, initially set to 0. Now you have to perform two operations on them:
1. Increase(F) by 1: flag F is increased by 1.
2. max_flag: all flags are set to a maximum value of any flag.
A non-empty array arr[] will be given of size M. This array represents consecutive operations:
... | Compilable |
For this Question: Gruumm has set up N lasers with i<sup>th</sup> laser having attack power Attack[i], all pointing earth. The damage caused by lasers on earth is the XOR of the attack powers of all the lasers. Cruger wants to set up a shield of defensive strength K. As Cruger has budget constraints, K can only be a no... | Compilable |
For this Question: Find factorial of a given number N.
<b>Note: </b>
The Factorial of a number is the product of an integer and all the integers below it;
e.g. factorial four ( 4! ) is equal to 24 (4*3*2*1).<b>User Task</b>
Since this is a functional problem, you don't have to worry about the input. You just have ... | Compilable |
For this Question: Find factorial of a given number N.
<b>Note: </b>
The Factorial of a number is the product of an integer and all the integers below it;
e.g. factorial four ( 4! ) is equal to 24 (4*3*2*1).<b>User Task</b>
Since this is a functional problem, you don't have to worry about the input. You just have ... | Compilable |
For this Question: Find factorial of a given number N.
<b>Note: </b>
The Factorial of a number is the product of an integer and all the integers below it;
e.g. factorial four ( 4! ) is equal to 24 (4*3*2*1).<b>User Task</b>
Since this is a functional problem, you don't have to worry about the input. You just have ... | Compilable |
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s... | Compilable |
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s... | Compilable |
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s... | Compilable |
For this Question: Bob was working on a new algorithm to make an array non-decreasing. he came up with the following algorithm :
For an array a of size n
Step 1: Select two indexes i and j, 0 ≤ i < j < n.
Step 2: if a[i] + a[j] is odd then do a[i] = a[j]
if a[i] + a[j] is even then do a[j] = a[i]
Step 3... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.