Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Complete the function <code>checkCanIVote</code>
<ol>
<li>Takes 2 arguments</li>
<li>1st argument <code>time</code>, which is the number of milliseconds after the function will resolve or reject</li>
<li>Second argument is the <code>age</code> upon (also a number) which you will use to return t... | Compilable |
For this Question: Implement the function <code>sumMaxMin</code>, which should take 5 numbers as input arguments.
The function should return the sum of max and min elements of those 5 numbers (Use JS In built functions)Function will take 5 arguments which will be numbers.Function will return a number which is the sum ... | Compilable |
For this Question: Implement the function <code>sumMaxMin</code>, which should take 5 numbers as input arguments.
The function should return the sum of max and min elements of those 5 numbers (Use JS In built functions)Function will take 5 arguments which will be numbers.Function will return a number which is the sum ... | 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: In this question, you will be adding a new method called <code>squareAndSort</code> to the <code>Array prototype</code>. This means that any array created in the future will have this method available to it. This method will be called on the <code>array with number and string data type elements</code... | 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: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Given an infix expression, your task is to convert it into postfix.
<b>Infix expression</b>: The expression of the form a operator b. When an operator is in- between every pair of operands.
<b>Postfix expression</b>: The expression of the form a b operator. When an operator is followed for every ... | Compilable |
For this Question: Given an infix expression, your task is to convert it into postfix.
<b>Infix expression</b>: The expression of the form a operator b. When an operator is in- between every pair of operands.
<b>Postfix expression</b>: The expression of the form a b operator. When an operator is followed for every ... | Compilable |
For this Question: Given an infix expression, your task is to convert it into postfix.
<b>Infix expression</b>: The expression of the form a operator b. When an operator is in- between every pair of operands.
<b>Postfix expression</b>: The expression of the form a b operator. When an operator is followed for every ... | Compilable |
For this Question: Write a program to print Five stars ('*') <b><i>vertically</i></b> and 5 <b><i>horizontally</i></b>
There will be two functions:
<ul>
<li>verticalFive(): Print stars in vertical order</li>
<li>horizontalFive(): Print stars in horizontal order</l>
</ul><b>User Task:</b>
Your task is to complet... | Compilable |
For this Question: Write a program to print Five stars ('*') <b><i>vertically</i></b> and 5 <b><i>horizontally</i></b>
There will be two functions:
<ul>
<li>verticalFive(): Print stars in vertical order</li>
<li>horizontalFive(): Print stars in horizontal order</l>
</ul><b>User Task:</b>
Your task is to complet... | Compilable |
For this Question: Morgan was opening some boxes when she found one bearing a message “For Morgan, Dad loves you 3000". She wants to open the box but she needs to solve the question to open it. She asks Peter to do that. Help Peter and Morgan solve the question so that they can see what's inside the box.
Given two a... | Compilable |
For this Question: Morgan was opening some boxes when she found one bearing a message “For Morgan, Dad loves you 3000". She wants to open the box but she needs to solve the question to open it. She asks Peter to do that. Help Peter and Morgan solve the question so that they can see what's inside the box.
Given two a... | Compilable |
For this Question: Morgan was opening some boxes when she found one bearing a message “For Morgan, Dad loves you 3000". She wants to open the box but she needs to solve the question to open it. She asks Peter to do that. Help Peter and Morgan solve the question so that they can see what's inside the box.
Given two a... | Compilable |
For this Question: How many ways are there to place a black and a white knight on an N * M chessboard such that they do not attack each other? The knights have to be placed on different squares. A knight can move two squares horizontally and one square vertically (L shaped), or two squares vertically and one square hor... | Compilable |
For this Question: How many ways are there to place a black and a white knight on an N * M chessboard such that they do not attack each other? The knights have to be placed on different squares. A knight can move two squares horizontally and one square vertically (L shaped), or two squares vertically and one square hor... | Compilable |
For this Question: How many ways are there to place a black and a white knight on an N * M chessboard such that they do not attack each other? The knights have to be placed on different squares. A knight can move two squares horizontally and one square vertically (L shaped), or two squares vertically and one square hor... | Compilable |
For this Question: Given an integer A, find the value of A + A<sup>2</sup> + A<sup>3</sup> +. . .+ A<sup>1000</sup>. As the answer can be large, output answer modulo 10<sup>9</sup>+7.The first and the only line of input contains a single integer A.
Constraints
1 <= A <= 10<sup>9</sup>Output a single integer, value ... | Compilable |
For this Question: Given an integer A, find the value of A + A<sup>2</sup> + A<sup>3</sup> +. . .+ A<sup>1000</sup>. As the answer can be large, output answer modulo 10<sup>9</sup>+7.The first and the only line of input contains a single integer A.
Constraints
1 <= A <= 10<sup>9</sup>Output a single integer, value ... | Compilable |
For this Question: Given an integer A, find the value of A + A<sup>2</sup> + A<sup>3</sup> +. . .+ A<sup>1000</sup>. As the answer can be large, output answer modulo 10<sup>9</sup>+7.The first and the only line of input contains a single integer A.
Constraints
1 <= A <= 10<sup>9</sup>Output a single integer, value ... | 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 an array <b>A</b> of <b>N</b> integers. Your teacher has asked you to find the maximum quotient of the array. Quotient of an array A of size N can be calculated in the following way:
1) Let the sum of the N elements of array A be <b>X</b>.
2) Let pre[] be another array of size N in which for ... | Compilable |
For this Question: Given an array <b>A</b> of <b>N</b> integers. Your teacher has asked you to find the maximum quotient of the array. Quotient of an array A of size N can be calculated in the following way:
1) Let the sum of the N elements of array A be <b>X</b>.
2) Let pre[] be another array of size N in which for ... | Compilable |
For this Question: Write a program to input three numbers from user and find maximum between three numbers using ternary operatorThe first line of the input contains three numbers a, b and c.
<b>Constraints<b>
1<= a, b, c <= 1e9Print the maximum NumberSample Input
12 14 15
Sample Output
15, I have written this... | Compilable |
For this Question: Write a program to input three numbers from user and find maximum between three numbers using ternary operatorThe first line of the input contains three numbers a, b and c.
<b>Constraints<b>
1<= a, b, c <= 1e9Print the maximum NumberSample Input
12 14 15
Sample Output
15, I have written this... | Compilable |
For this Question: Write a program to input three numbers from user and find maximum between three numbers using ternary operatorThe first line of the input contains three numbers a, b and c.
<b>Constraints<b>
1<= a, b, c <= 1e9Print the maximum NumberSample Input
12 14 15
Sample Output
15, I have written this... | Compilable |
For this Question: Sara is trying a new type of game in which she can jump in either the left direction or in the right direction. Also after each jump the range of her jump increases by 1 unit. i.e if starts from 1 in the next jump she has to jump 2 units then 3 units and so on.
Given the number of jumps as N, the ra... | Compilable |
For this Question: Sara is trying a new type of game in which she can jump in either the left direction or in the right direction. Also after each jump the range of her jump increases by 1 unit. i.e if starts from 1 in the next jump she has to jump 2 units then 3 units and so on.
Given the number of jumps as N, the ra... | Compilable |
For this Question: Sara is trying a new type of game in which she can jump in either the left direction or in the right direction. Also after each jump the range of her jump increases by 1 unit. i.e if starts from 1 in the next jump she has to jump 2 units then 3 units and so on.
Given the number of jumps as N, the ra... | Compilable |
For this Question: Sara is trying a new type of game in which she can jump in either the left direction or in the right direction. Also after each jump the range of her jump increases by 1 unit. i.e if starts from 1 in the next jump she has to jump 2 units then 3 units and so on.
Given the number of jumps as N, the ra... | Compilable |
For this Question: Anya owns N triplets of integers (A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub>), for each i from 1 to N. She asks you to find a sequence of integers which satisfies the following conditions:
1. The sequence contains at least C<sub>i</sub> distinct integers from the closed interval [A<sub>i</sub>, B... | Compilable |
For this Question: Anya owns N triplets of integers (A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub>), for each i from 1 to N. She asks you to find a sequence of integers which satisfies the following conditions:
1. The sequence contains at least C<sub>i</sub> distinct integers from the closed interval [A<sub>i</sub>, B... | Compilable |
For this Question: Given an array arr[] and a number K where K is not greater than the size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct.
<b>Note:</b>
Do Not Use sort() STL function, Use heap data structure.The input line contains T, de... | Compilable |
For this Question: Given an array arr[] and a number K where K is not greater than the size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct.
<b>Note:</b>
Do Not Use sort() STL function, Use heap data structure.The input line contains T, de... | Compilable |
For this Question: Given an array arr[] and a number K where K is not greater than the size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct.
<b>Note:</b>
Do Not Use sort() STL function, Use heap data structure.The input line contains T, de... | 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 two integers a and b your task is to print the summation of these two numbersInput contains a single line containing two space separated integers a and b.
Constraints:-
1 <= a, b <= 10<sup>20000</sup>Print the sum of a and b.Sample Input:-
3 8
Sample Output:-
11
Sample Input:-
15 1... | Compilable |
For this Question: Given two integers a and b your task is to print the summation of these two numbersInput contains a single line containing two space separated integers a and b.
Constraints:-
1 <= a, b <= 10<sup>20000</sup>Print the sum of a and b.Sample Input:-
3 8
Sample Output:-
11
Sample Input:-
15 1... | Compilable |
For this Question: Given two integers a and b your task is to print the summation of these two numbersInput contains a single line containing two space separated integers a and b.
Constraints:-
1 <= a, b <= 10<sup>20000</sup>Print the sum of a and b.Sample Input:-
3 8
Sample Output:-
11
Sample Input:-
15 1... | Compilable |
For this Question: You are given an array A of size N. Find the number of indexes i (1 <= i <= N) such that the sum of the elements to its right is atmost equal to the sum of elements to its left.The first line of input contains N, the size of the array.
The second line of input contains N space seperated integers A<s... | Compilable |
For this Question: You are given an array A of size N. Find the number of indexes i (1 <= i <= N) such that the sum of the elements to its right is atmost equal to the sum of elements to its left.The first line of input contains N, the size of the array.
The second line of input contains N space seperated integers A<s... | Compilable |
For this Question: Given a string s, find the first non-repeating character in the string and return its index. If it does not exist, return -1.First line of the input contains the string s.
<b>Constraints</b>
1<= s. length <= 100000Print the index of the first non- repeating character in a stringInput
s = "newto... | Compilable |
For this Question: Given a string s, find the first non-repeating character in the string and return its index. If it does not exist, return -1.First line of the input contains the string s.
<b>Constraints</b>
1<= s. length <= 100000Print the index of the first non- repeating character in a stringInput
s = "newto... | Compilable |
For this Question: Given a string s, find the first non-repeating character in the string and return its index. If it does not exist, return -1.First line of the input contains the string s.
<b>Constraints</b>
1<= s. length <= 100000Print the index of the first non- repeating character in a stringInput
s = "newto... | Compilable |
For this Question: Given an undirected graph, the task is to detect if there is a cycle in the undirected graph or not.The first line of input contains two integers N and M which denotes the no of vertices and no of edges in the graph respectively.
Next M lines contain space-separated integers u and v denoting that t... | Compilable |
For this Question: Given an undirected graph, the task is to detect if there is a cycle in the undirected graph or not.The first line of input contains two integers N and M which denotes the no of vertices and no of edges in the graph respectively.
Next M lines contain space-separated integers u and v denoting that t... | Compilable |
For this Question: Given an undirected graph, the task is to detect if there is a cycle in the undirected graph or not.The first line of input contains two integers N and M which denotes the no of vertices and no of edges in the graph respectively.
Next M lines contain space-separated integers u and v denoting that t... | Compilable |
For this Question: You are given a number n. Your task is to print the number of prime numbers before that number.The first line of the number of test cases T.
Next T lines contains the value of N.
<b>Constraints</b>
1 <= T <= 100
1 <= N <= 1000Print the number of primes numbers before that number.Sample Input 1:... | Compilable |
For this Question: You are given a number n. Your task is to print the number of prime numbers before that number.The first line of the number of test cases T.
Next T lines contains the value of N.
<b>Constraints</b>
1 <= T <= 100
1 <= N <= 1000Print the number of primes numbers before that number.Sample Input 1:... | Compilable |
For this Question: Given an integer array A of size N, find the minimum absolute difference between any two elements in the array.
We define the absolute difference between two elements ai and aj (where i != j ) is |ai - aj|.First line of input contains a single integer N, next line contains N space separated integers... | Compilable |
For this Question: Given an integer array A of size N, find the minimum absolute difference between any two elements in the array.
We define the absolute difference between two elements ai and aj (where i != j ) is |ai - aj|.First line of input contains a single integer N, next line contains N space separated integers... | Compilable |
For this Question: Given an integer array A of size N, find the minimum absolute difference between any two elements in the array.
We define the absolute difference between two elements ai and aj (where i != j ) is |ai - aj|.First line of input contains a single integer N, next line contains N space separated integers... | Compilable |
For this Question: Given an array A of N integers. The task is to count the number of ways to split given array elements into two disjoint groups, such that XOR of elements of each group is equal.The first line contains a single integer N, denoting the number of elements of the array.
The second line contains N intege... | Compilable |
For this Question: You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array, your task is to print the minimum size of the set so that at least half of the integers of the array are removed.The first line contains n the size of the array and the ... | Compilable |
For this Question: You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array, your task is to print the minimum size of the set so that at least half of the integers of the array are removed.The first line contains n the size of the array and the ... | Compilable |
For this Question: You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array, your task is to print the minimum size of the set so that at least half of the integers of the array are removed.The first line contains n the size of the array and the ... | Compilable |
For this Question: Given an integer N, your task is to print all the even integer from 1 to N.<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 a parameter.
</b>Constraints:</b>
1 <= N <= 10... | Compilable |
For this Question: Given an array of N integers and an integer K, your task is to calculate the count of pairs whose sum is divisible by K.The first line of input contains two integers N and K, the next line contains N space-separated integers depicting values of an array.
Constraints:-
1 < = N < = 100000
1 < = Ar... | Compilable |
For this Question: Given an array of N integers and an integer K, your task is to calculate the count of pairs whose sum is divisible by K.The first line of input contains two integers N and K, the next line contains N space-separated integers depicting values of an array.
Constraints:-
1 < = N < = 100000
1 < = Ar... | Compilable |
For this Question: Given an array of N integers and an integer K, your task is to calculate the count of pairs whose sum is divisible by K.The first line of input contains two integers N and K, the next line contains N space-separated integers depicting values of an array.
Constraints:-
1 < = N < = 100000
1 < = Ar... | Compilable |
For this Question: Given a sorted array arr[] of n elements, check whether a given element x is present in arr[] or not.The first line contains a single integer N.
next line contains N space-separated integer arr[i]
next line contains a single integer target(k)
Constraints
1<=N<=10^5
1<=A[i]<=10^9Determine wheth... | Compilable |
For this Question: Given a sorted array arr[] of n elements, check whether a given element x is present in arr[] or not.The first line contains a single integer N.
next line contains N space-separated integer arr[i]
next line contains a single integer target(k)
Constraints
1<=N<=10^5
1<=A[i]<=10^9Determine wheth... | Compilable |
For this Question: You are given an integer n, you have to print a Inverted half pyramid of size n.The first line contains a single Integer n.
<b>Constraints</b>
1 ≤ n ≤ 100Print inverted half pyramid of size n.Sample 1:
Input:
3
Output:
1 2 3
1 2
1
Explanation:
Inverted half pyramid of size 3., I ha... | Compilable |
For this Question: John and Olivia once start fighting when Olivia sees John talking with another girl. So, you tell them to play the game of love in which you give them an array A of size N. Now, the game will play in turns in which a player must decrease the value at the smallest index (with a non-zero value) in A by... | Compilable |
For this Question: Recently Ultron invented a new structure that he has called Xor Grid. It is an infinitely large grid G filled with numbers based on these three rules:
1. G[1, c] = 1 for all c ≥ 1
2. G[r, 1] = r for all r ≥ 1
3. G[r, c] = G[r - 1, c] xor G[r, c - 1] for all r > 1 and c > 1
Now Ultron is wonderin... | Compilable |
For this Question: Recently Ultron invented a new structure that he has called Xor Grid. It is an infinitely large grid G filled with numbers based on these three rules:
1. G[1, c] = 1 for all c ≥ 1
2. G[r, 1] = r for all r ≥ 1
3. G[r, c] = G[r - 1, c] xor G[r, c - 1] for all r > 1 and c > 1
Now Ultron is wonderin... | Compilable |
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N.
... | Compilable |
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N.
... | Compilable |
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N.
... | Compilable |
For this Question: They say friendship is greater than love. Why not play the famous game "FLAMES".
The rules are super simple. Given two strings (all lowercase), remove all the letters that are common to both the strings from both the strings. You cannot erase a character in first string whichever corresponding same ... | Compilable |
For this Question: They say friendship is greater than love. Why not play the famous game "FLAMES".
The rules are super simple. Given two strings (all lowercase), remove all the letters that are common to both the strings from both the strings. You cannot erase a character in first string whichever corresponding same ... | Compilable |
For this Question: They say friendship is greater than love. Why not play the famous game "FLAMES".
The rules are super simple. Given two strings (all lowercase), remove all the letters that are common to both the strings from both the strings. You cannot erase a character in first string whichever corresponding same ... | Compilable |
For this Question: Given two integers x and y, check if x can be converted to y by adding F(n) to x where F(n){n>=1} is defined as:- 1+3+9+27+81+. .3^n.<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>Ifpossible()</b> that takes the inte... | Compilable |
For this Question: Given two integers x and y, check if x can be converted to y by adding F(n) to x where F(n){n>=1} is defined as:- 1+3+9+27+81+. .3^n.<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>Ifpossible()</b> that takes the inte... | Compilable |
For this Question: Given two integers x and y, check if x can be converted to y by adding F(n) to x where F(n){n>=1} is defined as:- 1+3+9+27+81+. .3^n.<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>Ifpossible()</b> that takes the inte... | Compilable |
For this Question: Given two integers x and y, check if x can be converted to y by adding F(n) to x where F(n){n>=1} is defined as:- 1+3+9+27+81+. .3^n.<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>Ifpossible()</b> that takes the inte... | Compilable |
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input.
... | Compilable |
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input.
... | Compilable |
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input.
... | 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 an unsorted array <b>A[]</b> of size <b>N</b>. A triplet (i, j, k) is said to be special if they satisfy below two conditions:
<b>1. i < j < k</b>
<b>2. A<sub>i</sub> < A<sub>j</sub> < A<sub>k</sub></b>
<b>V<sub>(A<sub>i</sub>,A<sub>j</sub>,A<sub>k</sub>)</sub>: A<sub>i</sub> + (A<sub>j</s... | Compilable |
For this Question: Given an unsorted array <b>A[]</b> of size <b>N</b>. A triplet (i, j, k) is said to be special if they satisfy below two conditions:
<b>1. i < j < k</b>
<b>2. A<sub>i</sub> < A<sub>j</sub> < A<sub>k</sub></b>
<b>V<sub>(A<sub>i</sub>,A<sub>j</sub>,A<sub>k</sub>)</sub>: A<sub>i</sub> + (A<sub>j</s... | Compilable |
For this Question: You are given an array A of size N. You have to print the maximum in every <b>K-sized subarray</b> from the left to the right in the array A.
More formally, you have to print N - K + 1 integers X<sub>1</sub>, X<sub>2</sub>, ..., X<sub>N-K+1</sub> such that X<sub>i</sub> (1 <= i <= N - K + 1) is the ... | Compilable |
For this Question: You are given an array A of size N. You have to print the maximum in every <b>K-sized subarray</b> from the left to the right in the array A.
More formally, you have to print N - K + 1 integers X<sub>1</sub>, X<sub>2</sub>, ..., X<sub>N-K+1</sub> such that X<sub>i</sub> (1 <= i <= N - K + 1) is the ... | Compilable |
For this Question: You are given an array A of size N. You have to print the maximum in every <b>K-sized subarray</b> from the left to the right in the array A.
More formally, you have to print N - K + 1 integers X<sub>1</sub>, X<sub>2</sub>, ..., X<sub>N-K+1</sub> such that X<sub>i</sub> (1 <= i <= N - K + 1) is the ... | Compilable |
For this Question: Harry wants to rescue Fleur's sister Gabrielle in the underwater task. For that he needs to get ahead of all the people in the two magical queues.
Our small Tono and Solo are busy casting spells alternatively to remove people from the two magical queues. But since they are highly competitive, both ... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.