Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: Given the length, breadth, and height of a cuboid. Your task is to calculate its Perimeter.
Note:- Formula for the perimeter of the cuboid is 4(Length + Breadth + height)<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... | Compilable |
For this Question: Given the length, breadth, and height of a cuboid. Your task is to calculate its Perimeter.
Note:- Formula for the perimeter of the cuboid is 4(Length + Breadth + height)<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... | Compilable |
For this Question: Given an integer N, your task is to check whether the given number is prime or notThe input contains a single integer N.
Constraints:-
1 <= N <= 100000000000Print "YES" If the given number is prime else print "NO".Sample Input:-
2
Sample Output:-
YES
Sample Input:-
4
Sample Output:-
... | Compilable |
For this Question: Given an integer N, your task is to check whether the given number is prime or notThe input contains a single integer N.
Constraints:-
1 <= N <= 100000000000Print "YES" If the given number is prime else print "NO".Sample Input:-
2
Sample Output:-
YES
Sample Input:-
4
Sample Output:-
... | Compilable |
For this Question: Given an integer N, your task is to check whether the given number is prime or notThe input contains a single integer N.
Constraints:-
1 <= N <= 100000000000Print "YES" If the given number is prime else print "NO".Sample Input:-
2
Sample Output:-
YES
Sample Input:-
4
Sample Output:-
... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Newton loves EVEN numbers.
You are given two integers N and M. Generate 5 unique even numbers for Newton between N and M (excluding both).The first and only line of input contains integer N and integer M.
Constraints
-10<sup>3</sup> ≤ N ≤ M ≤ 10<sup>3</sup>
10 ≤ M-NThe only line... | Compilable |
For this Question: Given a linked list, the task is to move all 0’s to the front of the linked list. The order of all another element except 0 should be same after rearrangement.
Note: Avoid use of any type of Java Collection frameworks.
Note: For custom input/output, enter the list in reverse order, and the outp... | Compilable |
For this Question: In a new plot by Hydra to kill the avengers, Doctor Zola comes up with a new form of poison composed of chromosomes A, C, T and G. The poison is a string of length n (where n is divisible by 4) with each of the four letters occurring exactly n/4 times. For example, GACT and AAGTGCCT are both fatal po... | Compilable |
For this Question: In a new plot by Hydra to kill the avengers, Doctor Zola comes up with a new form of poison composed of chromosomes A, C, T and G. The poison is a string of length n (where n is divisible by 4) with each of the four letters occurring exactly n/4 times. For example, GACT and AAGTGCCT are both fatal po... | Compilable |
For this Question: In a new plot by Hydra to kill the avengers, Doctor Zola comes up with a new form of poison composed of chromosomes A, C, T and G. The poison is a string of length n (where n is divisible by 4) with each of the four letters occurring exactly n/4 times. For example, GACT and AAGTGCCT are both fatal po... | Compilable |
For this Question: Andrew is now bored with usual prime numbers and decides to find prime numbers which has exactly three factors. He sits back and keeps on thinking random numbers, and asks you to tell him if the number he has chosen had exactly 3 factors. Now he has given <b>N</b> random numbers, you need to tell hi... | Compilable |
For this Question: Andrew is now bored with usual prime numbers and decides to find prime numbers which has exactly three factors. He sits back and keeps on thinking random numbers, and asks you to tell him if the number he has chosen had exactly 3 factors. Now he has given <b>N</b> random numbers, you need to tell hi... | Compilable |
For this Question: Andrew is now bored with usual prime numbers and decides to find prime numbers which has exactly three factors. He sits back and keeps on thinking random numbers, and asks you to tell him if the number he has chosen had exactly 3 factors. Now he has given <b>N</b> random numbers, you need to tell hi... | Compilable |
For this Question: There is a rope of length L which you have to cut at 11 positions to divide it into 12 ropes. Here, each of the 12 resulting ropes must have a positive integer length.
Find the number of ways to do this division.
Note: Two ways to do the division are considered different if and only if there is a p... | Compilable |
For this Question: There is a rope of length L which you have to cut at 11 positions to divide it into 12 ropes. Here, each of the 12 resulting ropes must have a positive integer length.
Find the number of ways to do this division.
Note: Two ways to do the division are considered different if and only if there is a p... | Compilable |
For this Question: There is a rope of length L which you have to cut at 11 positions to divide it into 12 ropes. Here, each of the 12 resulting ropes must have a positive integer length.
Find the number of ways to do this division.
Note: Two ways to do the division are considered different if and only if there is a p... | Compilable |
For this Question: Padding is a process of adding layers of zeros to the input image. If we want to have p layers of padding then we have to add p layers of zeroes on borders.
Given two integers N and p. How many zeroes are needed to be added to N X N image to give p layers of zero padding?First line contains N and ... | Compilable |
For this Question: Given an array "a" of non-Integers, check if any integer in the array is less than k.The first line contains two Integers n and k, which is the size of the array and k.
The second line contains n space- separated Integers, that is array elements.
<b>Constraints</b>
1 ≤ n ≤ 100
1 ≤ k &l... | Compilable |
For this Question: Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well.Functional problem, Number is the input
Constraint:-
1<=size of n<=100000Output is a single line containing reversed number n.Sample Input
123445
Sample Output
... | Compilable |
For this Question: Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well.Functional problem, Number is the input
Constraint:-
1<=size of n<=100000Output is a single line containing reversed number n.Sample Input
123445
Sample Output
... | Compilable |
For this Question: Given a string of length N, count the number of vowels present at even places.First line of input contains a single integer N. Second line contains a string of size N.
Constraints:-
1 <= N <= 100000
Note:- String will contain only lowercase english letterPrint the number of vowels present at t... | Compilable |
For this Question: Given a string of length N, count the number of vowels present at even places.First line of input contains a single integer N. Second line contains a string of size N.
Constraints:-
1 <= N <= 100000
Note:- String will contain only lowercase english letterPrint the number of vowels present at t... | Compilable |
For this Question: Given a string of length N, count the number of vowels present at even places.First line of input contains a single integer N. Second line contains a string of size N.
Constraints:-
1 <= N <= 100000
Note:- String will contain only lowercase english letterPrint the number of vowels present at t... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a number N, find the value of the below Equation for the given number.
Equation: -
N
∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2}
X = 1<b>User task:</b>
Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu... | Compilable |
For this Question: Given a string, the task is to remove duplicates from it. Expected time complexity O(n) where n is length of the input string and extra space O(1) under the assumption that there are total of 256 possible characters in a string.
Note: that original order of characters must be kept same.The first l... | Compilable |
For this Question: Given a string, the task is to remove duplicates from it. Expected time complexity O(n) where n is length of the input string and extra space O(1) under the assumption that there are total of 256 possible characters in a string.
Note: that original order of characters must be kept same.The first l... | Compilable |
For this Question: Given a string, the task is to remove duplicates from it. Expected time complexity O(n) where n is length of the input string and extra space O(1) under the assumption that there are total of 256 possible characters in a string.
Note: that original order of characters must be kept same.The first l... | Compilable |
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter.
Constraints:-
1<=N<=10^9Return t... | Compilable |
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter.
Constraints:-
1<=N<=10^9Return t... | Compilable |
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter.
Constraints:-
1<=N<=10^9Return t... | Compilable |
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter.
Constraints:-
1<=N<=10^9Return t... | Compilable |
For this Question: Given two integers N and D, your task is to find the numbers between 1 to N which contains the digit D at least 1 time.Input contains only two integers N and D.
Constraints:-
1 < = N < = 100000
1 < = D < = 9Print all the numbers from 1 to N which contains the digit D in it separated by space in ... | Compilable |
For this Question: Given two integers N and D, your task is to find the numbers between 1 to N which contains the digit D at least 1 time.Input contains only two integers N and D.
Constraints:-
1 < = N < = 100000
1 < = D < = 9Print all the numbers from 1 to N which contains the digit D in it separated by space in ... | Compilable |
For this Question: Given two integers N and D, your task is to find the numbers between 1 to N which contains the digit D at least 1 time.Input contains only two integers N and D.
Constraints:-
1 < = N < = 100000
1 < = D < = 9Print all the numbers from 1 to N which contains the digit D in it separated by space in ... | 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: Given an array arr[] of N integers arranged in a circular fashion. Your task is to find the maximum contiguous subarray sum containing at least 1 element.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single inte... | Compilable |
For this Question: Given an array arr[] of N integers arranged in a circular fashion. Your task is to find the maximum contiguous subarray sum containing at least 1 element.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single inte... | Compilable |
For this Question: Given an array arr[] of N integers arranged in a circular fashion. Your task is to find the maximum contiguous subarray sum containing at least 1 element.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single inte... | Compilable |
For this Question: Given two elements A and B, your task is to swap the given two elements.<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>Swap(int A, int B)</b>.Print one line which contains the output of swapped elements.Sample Input:... | Compilable |
For this Question: Given two elements A and B, your task is to swap the given two elements.<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>Swap(int A, int B)</b>.Print one line which contains the output of swapped elements.Sample Input:... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | 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: 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: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: Gian and Suneo want their heights to be equal so they asked Doraemon's help. Doraemon gave a big light to both of them but the both big lights have different speed of magnifying. Let's assume the big light given to Gian can increase height of a person by v1 m/s and that of Suneo's big light is v2 m/s... | Compilable |
For this Question: You are given a chessboard of size N x N, where the top left square is black. Each square contains a value. Find the sum of the values of all black squares and all white squares.
Remember that in a chessboard black and white squares are alternate.The first line of input will be the N size of the m... | Compilable |
For this Question: You are given a chessboard of size N x N, where the top left square is black. Each square contains a value. Find the sum of the values of all black squares and all white squares.
Remember that in a chessboard black and white squares are alternate.The first line of input will be the N size of the m... | Compilable |
For this Question: Given a 2*N matrix in which each cell contains some candies in it. You are at the top left corner of the matrix and want to reach the bottom right corner of the matrix i. e from (1, 1) to (2, N). You can only move right or down. You have to find the maximum number of candies you can collect in your j... | Compilable |
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S.
C... | Compilable |
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S.
C... | Compilable |
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S.
C... | Compilable |
For this Question: A permutation is simply a name for a reordering. So the permutations of the string
‘abc’ are ‘abc’, ‘acb’, ‘bac’, ‘bca’, ‘cab’, and ‘cba’. Note that a sequence is a
permutation of itself (the trivial permutation). For this problem, you’ll need
to write a recursive function that takes a str... | Compilable |
For this Question: A permutation is simply a name for a reordering. So the permutations of the string
‘abc’ are ‘abc’, ‘acb’, ‘bac’, ‘bca’, ‘cab’, and ‘cba’. Note that a sequence is a
permutation of itself (the trivial permutation). For this problem, you’ll need
to write a recursive function that takes a str... | Compilable |
For this Question: A permutation is simply a name for a reordering. So the permutations of the string
‘abc’ are ‘abc’, ‘acb’, ‘bac’, ‘bca’, ‘cab’, and ‘cba’. Note that a sequence is a
permutation of itself (the trivial permutation). For this problem, you’ll need
to write a recursive function that takes a str... | Compilable |
For this Question: You are given a grid having N*M elements. Find the index of the row (1-base indexing) which has the maximum sum of elements.
Note: if more than two rows have the same sum of elements, then return the smallest index.The first line of the input contains two integers N and M.
The next N lines each con... | Compilable |
For this Question: You are given a grid having N*M elements. Find the index of the row (1-base indexing) which has the maximum sum of elements.
Note: if more than two rows have the same sum of elements, then return the smallest index.The first line of the input contains two integers N and M.
The next N lines each con... | Compilable |
For this Question: You are given an array of integers arr of size n, a window of size k. Your task is to find the sum of the maximum element from each window.The first line contains the input of n, k ie the size of the array, and the size of the window.
The next line contains the input of the array.
<b>Constraints<... | Compilable |
For this Question: You are given an array of integers arr of size n, a window of size k. Your task is to find the sum of the maximum element from each window.The first line contains the input of n, k ie the size of the array, and the size of the window.
The next line contains the input of the array.
<b>Constraints<... | Compilable |
For this Question: Create a <code>Product</code> constructor function which should take three arguments: <code>name</code>, <code>price</code>, and <code>manufacturer</code>. These arguments should be used to set the initial values of the name, price, and manufacturer properties respectively.
<ol>
<li>Add a <code>... | Compilable |
For this Question: We have five cards with integers A, B, C, D, and E written on them, one on each card.
This set of five cards is called a <b>Full house</b> if and only if the following below condition is satisfied:
1. Any three cards with the same number written on them
2. Rest two cards with the same numbers wr... | Compilable |
For this Question: You are given a square matrix of size N*N. Initially all elements of this matrix are equal to 0. You are given Q queries. Each query consists of two integers, i and j (1 <= i, j <= N) wherein you increase the value of all elements in the i<sup>th</sup> row and j<sup>th</sup> column by 1. After doing ... | Compilable |
For this Question: Given an array A and an integer K. Find the maximum for each and every contiguous subarray of size K.
Problem asked in Amazon, Flipkart.The first line of each test case contains a single integer N denoting the size of array and the size of subarray K. The second line contains N space-separated i... | Compilable |
For this Question: Given an array A and an integer K. Find the maximum for each and every contiguous subarray of size K.
Problem asked in Amazon, Flipkart.The first line of each test case contains a single integer N denoting the size of array and the size of subarray K. The second line contains N space-separated i... | Compilable |
For this Question: Given an array A and an integer K. Find the maximum for each and every contiguous subarray of size K.
Problem asked in Amazon, Flipkart.The first line of each test case contains a single integer N denoting the size of array and the size of subarray K. The second line contains N space-separated i... | Compilable |
For this Question: Given an integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | Compilable |
For this Question: Given an integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | Compilable |
For this Question: Given an integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | Compilable |
For this Question: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: Ketani is fond of super simple problems. This time he has come up with another simple problem. Given two non negative numbers A and B. Find the number of multiples of k in the range [A, B] (all integers between A and B, A and B inclusive).The first and the only line of input contains three integers: ... | Compilable |
For this Question: Ketani is fond of super simple problems. This time he has come up with another simple problem. Given two non negative numbers A and B. Find the number of multiples of k in the range [A, B] (all integers between A and B, A and B inclusive).The first and the only line of input contains three integers: ... | Compilable |
For this Question: Ketani is fond of super simple problems. This time he has come up with another simple problem. Given two non negative numbers A and B. Find the number of multiples of k in the range [A, B] (all integers between A and B, A and B inclusive).The first and the only line of input contains three integers: ... | Compilable |
For this Question: You are given a positive integer A. You have to apply the following operation on it N times:
<ul><li>Let the maximum and minimum digits in the decimal representation of A be <i>mx</i> and <i>mn</i> respectively. </li><li>Add mx*mn to A, i. e, convert A to A + mx*mn. </li></ul>Find the value of A aft... | Compilable |
For this Question: Given an array A[] and a range [a, b]. The task is to partition the array around the range such that array is divided into three parts.
1) All elements smaller than a come first.
2) All elements in range a to b come next.
3) All elements greater than b appear in the end.
The individual elements o... | Compilable |
For this Question: Given an array A[] and a range [a, b]. The task is to partition the array around the range such that array is divided into three parts.
1) All elements smaller than a come first.
2) All elements in range a to b come next.
3) All elements greater than b appear in the end.
The individual elements o... | Compilable |
For this Question: Given a matrix of N*N dimensions. Take the input and display the matrix as an output.First line contains N.
N lines follow each containing N space seperated integers.
Constraints:-
2 <= N <= 500
1 <= Mat[i][j] <= 1000Print the given matrix.Input:
2
3 4
7 6
Output:
3 4
7 6
Input:
... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.