Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Andy loves Xor. Dwight gives Andy an integer N and asks him to tell whether XOR of all the integers from 1 to N is even or odd. As Andy is busy flirting with Erin, help him solve this problem.Input contains a single integer N.
Constraints:
1 <= N <= 10^9Print "even" if XOR of all the integers fro... | Compilable |
For this Question: Andy loves Xor. Dwight gives Andy an integer N and asks him to tell whether XOR of all the integers from 1 to N is even or odd. As Andy is busy flirting with Erin, help him solve this problem.Input contains a single integer N.
Constraints:
1 <= N <= 10^9Print "even" if XOR of all the integers fro... | Compilable |
For this Question: Andy loves Xor. Dwight gives Andy an integer N and asks him to tell whether XOR of all the integers from 1 to N is even or odd. As Andy is busy flirting with Erin, help him solve this problem.Input contains a single integer N.
Constraints:
1 <= N <= 10^9Print "even" if XOR of all the integers fro... | 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: Given an array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | Compilable |
For this Question: Given an array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | Compilable |
For this Question: Given an array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | 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 a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: After sitting idle in home for around 2 months, Jiraya has finally come up with a super interesting problem on arrays (or maybe!).
You are given an array A of N integers. You need to choose an index i from 1 to N (inclusive) and divide this array into 2 parts, then find the maximum sum of contiguou... | Compilable |
For this Question: After sitting idle in home for around 2 months, Jiraya has finally come up with a super interesting problem on arrays (or maybe!).
You are given an array A of N integers. You need to choose an index i from 1 to N (inclusive) and divide this array into 2 parts, then find the maximum sum of contiguou... | Compilable |
For this Question: After sitting idle in home for around 2 months, Jiraya has finally come up with a super interesting problem on arrays (or maybe!).
You are given an array A of N integers. You need to choose an index i from 1 to N (inclusive) and divide this array into 2 parts, then find the maximum sum of contiguou... | Compilable |
For this Question: You are given a string S consisting of lowercase English letters. Determine whether adding some number of a's (possibly zero) at the beginning of S can make it a palindrome.The input consists of a single string S.
Constraints
1 ≤ ∣S∣ ≤ 10^6
S consists of lowercase English letters.If adding... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | 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: Implement <code>getObjKeys</code> which only takes one argument which will be a object.
The function should return all they keys present in object as a string where elements are seperated by a ', '. (No nested objects)(Use JS Built in function)Function will take one argument which will be an objectF... | Compilable |
For this Question: Given a postfix expression, your task is to evaluate given expression.
Infix expression: The expression of the form a operator b. When an operator is in-between every pair of operands.
Postfix expression: The expression of the form a b operator. When an operator is followed for every pair of oper... | Compilable |
For this Question: Given a postfix expression, your task is to evaluate given expression.
Infix expression: The expression of the form a operator b. When an operator is in-between every pair of operands.
Postfix expression: The expression of the form a b operator. When an operator is followed for every pair of oper... | Compilable |
For this Question: Given a postfix expression, your task is to evaluate given expression.
Infix expression: The expression of the form a operator b. When an operator is in-between every pair of operands.
Postfix expression: The expression of the form a b operator. When an operator is followed for every pair of oper... | Compilable |
For this Question: Given a number N. Write a program to the find number of diagonals possible in N sided convex polygon.<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>numberOfDiagonal()</b> that takes the integer N parameter.
Constr... | Compilable |
For this Question: Given a number N. Write a program to the find number of diagonals possible in N sided convex polygon.<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>numberOfDiagonal()</b> that takes the integer N parameter.
Constr... | Compilable |
For this Question: Given a number N. Write a program to the find number of diagonals possible in N sided convex polygon.<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>numberOfDiagonal()</b> that takes the integer N parameter.
Constr... | Compilable |
For this Question: Given a number N. Write a program to the find number of diagonals possible in N sided convex polygon.<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>numberOfDiagonal()</b> that takes the integer N parameter.
Constr... | Compilable |
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K
Constraints :
0 <= L <= R <= 1000000000000000000(10^18)
1 <= K <= 1000000000000000000(10^18)Output a single int... | Compilable |
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K
Constraints :
0 <= L <= R <= 1000000000000000000(10^18)
1 <= K <= 1000000000000000000(10^18)Output a single int... | Compilable |
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K
Constraints :
0 <= L <= R <= 1000000000000000000(10^18)
1 <= K <= 1000000000000000000(10^18)Output a single int... | 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: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | Compilable |
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | Compilable |
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | 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: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1.
For a given number N, find the closest silly number.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the funct... | Compilable |
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1.
For a given number N, find the closest silly number.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the funct... | Compilable |
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1.
For a given number N, find the closest silly number.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the funct... | Compilable |
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1.
For a given number N, find the closest silly number.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the funct... | Compilable |
For this Question: You have a box of paint. The paint can be used to cover area of 1 square unit. You have N magic spells with magic value from 1 to N. You can use each spell at max once.
When you use a spell on the box of paint, the quantity of paint in the box gets multiplied by the magic value of that spell. For e... | Compilable |
For this Question: Yogi and Dharam are playing a game in which one has to solve the problem in order to get out of the room. Dharam goes first and Yogi gave him a problem. Since Dharam is having problem solving it, your task is to solve the problem for him.
Problem:-
Given a range from A to B your task is to count ... | Compilable |
For this Question: Yogi and Dharam are playing a game in which one has to solve the problem in order to get out of the room. Dharam goes first and Yogi gave him a problem. Since Dharam is having problem solving it, your task is to solve the problem for him.
Problem:-
Given a range from A to B your task is to count ... | 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: Modify the <code>takeMultipleNumbersAndAdd </code> such that it can take any number of arguments
and return its sum.
This is JS only question.Function should be able to take any number of argsSum of the numberstakeMultipleNumbersAndAdd(1, 2, 2) should return 5 because 1 + 2 + 2
takeMultipleNu... | Compilable |
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr.
All the elements of the array are distinct.First line of input contains a single integer N.
Second line of input contains N integers denoting the array Arr.
Constraints:
1 <= N <= 100000
1 <= Arr[i] <=... | Compilable |
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr.
All the elements of the array are distinct.First line of input contains a single integer N.
Second line of input contains N integers denoting the array Arr.
Constraints:
1 <= N <= 100000
1 <= Arr[i] <=... | Compilable |
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr.
All the elements of the array are distinct.First line of input contains a single integer N.
Second line of input contains N integers denoting the array Arr.
Constraints:
1 <= N <= 100000
1 <= Arr[i] <=... | Compilable |
For this Question: Alice like grids. Today, she is playing a computer game on an N*M grid.
The rows of the grid are numbered from 1 to N and the columns are numbered from 1 to M. The cell in row A and column B is represented as (A, B).
The grid has K lasers in it. Each laser is fixed at a single cell of the grid... | Compilable |
For this Question: Given a linked list consisting of N nodes, your task is to delete every kth Node from the circular linked list until only one node is left. Also, print the intermediate lists
<b>Note:
Sample Input and Output just show how a linked list will look depending on the questions. Do not copy-paste as i... | Compilable |
For this Question: There are N line segments on the 2-D plane. The endpoints of the i<sup>th</sup> line segment are (0, i) and (1, P<sub>i</sub>). Now your task is to highlight all the line segments so that small Tono can analyze them properly. The cost of highlighting the i<sup>th</sup> line segment is C<sub>i</sub>. ... | 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: 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: You are given three distinct positive integers, A, B and C, in the input. Your task is to find their median.
The median of a set of integers is the number at the middle position if they are arranged in ascending order.The input consists of a single line containing three integers A, B and C.
<b... | Compilable |
For this Question: You are given three distinct positive integers, A, B and C, in the input. Your task is to find their median.
The median of a set of integers is the number at the middle position if they are arranged in ascending order.The input consists of a single line containing three integers A, B and C.
<b... | Compilable |
For this Question: You are given three distinct positive integers, A, B and C, in the input. Your task is to find their median.
The median of a set of integers is the number at the middle position if they are arranged in ascending order.The input consists of a single line containing three integers A, B and C.
<b... | Compilable |
For this Question: Given two arrays of size N which have the same values but in different orders, we need to make a second array the same as a first array using a minimum number of swaps.
Note:- It is guaranteed that the elements of the array are uniqueFirst line of input contains the size of array N, second line of... | Compilable |
For this Question: Given two arrays of size N which have the same values but in different orders, we need to make a second array the same as a first array using a minimum number of swaps.
Note:- It is guaranteed that the elements of the array are uniqueFirst line of input contains the size of array N, second line of... | Compilable |
For this Question: N numbers are arranged in Circle. Find the Sum of all K contiguous Sub-arrays.The first line of the input contains an integer N, the length of the array, and K. The next line contains N integers which are elements of the array.
<b>User task:</b> Since this is a functional problem you don't have t... | Compilable |
For this Question: N numbers are arranged in Circle. Find the Sum of all K contiguous Sub-arrays.The first line of the input contains an integer N, the length of the array, and K. The next line contains N integers which are elements of the array.
<b>User task:</b> Since this is a functional problem you don't have t... | Compilable |
For this Question: N numbers are arranged in Circle. Find the Sum of all K contiguous Sub-arrays.The first line of the input contains an integer N, the length of the array, and K. The next line contains N integers which are elements of the array.
<b>User task:</b> Since this is a functional problem you don't have t... | Compilable |
For this Question: N numbers are arranged in Circle. Find the Sum of all K contiguous Sub-arrays.The first line of the input contains an integer N, the length of the array, and K. The next line contains N integers which are elements of the array.
<b>User task:</b> Since this is a functional problem you don't have t... | Compilable |
For this Question: N numbers are arranged in Circle. Find the Sum of all K contiguous Sub-arrays.The first line of the input contains an integer N, the length of the array, and K. The next line contains N integers which are elements of the array.
<b>User task:</b> Since this is a functional problem you don't have t... | Compilable |
For this Question: Priyanka works for an international toy company that ships by container. Her task is to the determine the lowest cost way to combine her orders for shipping. She has a list of item weights. The shipping company has a requirement that all items loaded in a container must weigh less than or equal to 4 ... | Compilable |
For this Question: Priyanka works for an international toy company that ships by container. Her task is to the determine the lowest cost way to combine her orders for shipping. She has a list of item weights. The shipping company has a requirement that all items loaded in a container must weigh less than or equal to 4 ... | Compilable |
For this Question: Priyanka works for an international toy company that ships by container. Her task is to the determine the lowest cost way to combine her orders for shipping. She has a list of item weights. The shipping company has a requirement that all items loaded in a container must weigh less than or equal to 4 ... | 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: Aarav is standing at location X and Reena is standing at location Y. In one step Aarav can increase or decrease his location by at most A. What is the minimum no. of steps required by Aarav to reach Reena?The first line of input will contain a single integer T, denoting the number of test cases. Each... | Compilable |
For this Question: Aarav is standing at location X and Reena is standing at location Y. In one step Aarav can increase or decrease his location by at most A. What is the minimum no. of steps required by Aarav to reach Reena?The first line of input will contain a single integer T, denoting the number of test cases. Each... | 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: Find the least subarray size <b>K</b> required from two arrays <b>A</b> and <b>B</b> (their positions don't matter), so that the product of the sum of those two subarrays is at least <b>S</b>. If no answer exists, print -1.The first line contains the integer T(the number of test cases).
Each test ca... | Compilable |
For this Question: You are given an array with all distinct elements which include all elements of a binary search tree in an increasing order manner (in-order traversal). But 2 element swapped their position. we have to print the sum of two swapped nodes.The first line contains a single integer N.
The second line con... | Compilable |
For this Question: You are given an array with all distinct elements which include all elements of a binary search tree in an increasing order manner (in-order traversal). But 2 element swapped their position. we have to print the sum of two swapped nodes.The first line contains a single integer N.
The second line con... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | 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 an array of N integers find the number of mountains in the array. A mountain is a tuple (i,j,k,l,m) such that i < j < k < l < m and Arr[i] < Arr[j] < Arr[k] > Arr[l] > Arr[m].
As the number of such mountains can be large print number of mountains modulo 1000000007The first line of input conta... | Compilable |
For this Question: Given an array of N integers find the number of mountains in the array. A mountain is a tuple (i,j,k,l,m) such that i < j < k < l < m and Arr[i] < Arr[j] < Arr[k] > Arr[l] > Arr[m].
As the number of such mountains can be large print number of mountains modulo 1000000007The first line of input conta... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.