Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Anjali has 3 balls of sizes X, Y, and Z respectively, She puts the balls in boxes of size A (X ≤ Y ≤ Z ≤ A). Determine the bare minimum of boxes Anjali requires to fit each ball inside a box. If the total size of the balls inside the box does not exceed the size of the box, then the box may ... | 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: Given a stack of integers and N queries. Your task is to perform these operations:-
<b>push:-</b>this operation will add an element to your current stack.
<b>pop:-</b>remove the element that is on top
<b>top:-</b>print the element which is currently on top of stack
<b>Note:-</b>if the stack is ... | Compilable |
For this Question: Andrew loves to solve problems related to prime numbers. One of Andrew's friend has asked him to solve below problem for him.
Given two positive integers <b>N</b> and <b>M</b>, the task is to check that N is the Mth power of a <b>prime number</b> or not.First line of input contains testcases <b>T</... | Compilable |
For this Question: Andrew loves to solve problems related to prime numbers. One of Andrew's friend has asked him to solve below problem for him.
Given two positive integers <b>N</b> and <b>M</b>, the task is to check that N is the Mth power of a <b>prime number</b> or not.First line of input contains testcases <b>T</... | Compilable |
For this Question: Andrew loves to solve problems related to prime numbers. One of Andrew's friend has asked him to solve below problem for him.
Given two positive integers <b>N</b> and <b>M</b>, the task is to check that N is the Mth power of a <b>prime number</b> or not.First line of input contains testcases <b>T</... | Compilable |
For this Question: Blue Ranger hates palindromic strings and he is also jealous of Red Ranger. So to test Red Ranger he gives him a task. Given N and M, Red Ranger must find a string of length N and containing at max M distinct english alphabets such that the string contains minimum substrings that are palindromes. As ... | Compilable |
For this Question: Blue Ranger hates palindromic strings and he is also jealous of Red Ranger. So to test Red Ranger he gives him a task. Given N and M, Red Ranger must find a string of length N and containing at max M distinct english alphabets such that the string contains minimum substrings that are palindromes. As ... | Compilable |
For this Question: Blue Ranger hates palindromic strings and he is also jealous of Red Ranger. So to test Red Ranger he gives him a task. Given N and M, Red Ranger must find a string of length N and containing at max M distinct english alphabets such that the string contains minimum substrings that are palindromes. As ... | 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: 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: Power Rangers have to trap a evil spirit monster into a cuboid shape box with dimensions A*B*C, where A, B and C are positive integers. The volume of the box should be exactly X cubic units (that is A*B*C should be equal to X). To allow minimum evil aura to leak from the box the surface area of the b... | Compilable |
For this Question: Power Rangers have to trap a evil spirit monster into a cuboid shape box with dimensions A*B*C, where A, B and C are positive integers. The volume of the box should be exactly X cubic units (that is A*B*C should be equal to X). To allow minimum evil aura to leak from the box the surface area of the b... | Compilable |
For this Question: Power Rangers have to trap a evil spirit monster into a cuboid shape box with dimensions A*B*C, where A, B and C are positive integers. The volume of the box should be exactly X cubic units (that is A*B*C should be equal to X). To allow minimum evil aura to leak from the box the surface area of the b... | Compilable |
For this Question: The coolness of the subarray of an array is the sum of elements in the subarray. The coolest subarray is the subarray having the maximum coolness, while the hottest subarray is the one having minimum coolness (obviously it can be negative). The coolest and the hottest subarrays are always <b>non-empt... | Compilable |
For this Question: The coolness of the subarray of an array is the sum of elements in the subarray. The coolest subarray is the subarray having the maximum coolness, while the hottest subarray is the one having minimum coolness (obviously it can be negative). The coolest and the hottest subarrays are always <b>non-empt... | Compilable |
For this Question: The coolness of the subarray of an array is the sum of elements in the subarray. The coolest subarray is the subarray having the maximum coolness, while the hottest subarray is the one having minimum coolness (obviously it can be negative). The coolest and the hottest subarrays are always <b>non-empt... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given a 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 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: Walter white is considered very intelligent person. He has a problem to solve. As he is suffering from cancer, can you help him solve it?
Given two integer arrays C and S of length c and s respectively. Index i of array S can be considered good if a subarray of length c can be formed starting from... | Compilable |
For this Question: Given an integer Q representing the number of queries and an integer K. There are two types of queries:
(i) 1 x : Add the number x to the stream
(ii) 2 : Print the sum of last K numbers of the stream. If there are less than K numbers in the stream, print the sum of current stream.
Process all the ... | Compilable |
For this Question: Given an integer Q representing the number of queries and an integer K. There are two types of queries:
(i) 1 x : Add the number x to the stream
(ii) 2 : Print the sum of last K numbers of the stream. If there are less than K numbers in the stream, print the sum of current stream.
Process all the ... | Compilable |
For this Question: For two strings A and B, let A + B denote the concatenation of A and B in this order.
You are given N strings Si,. , SN. Modify and print them as follows, in the order i = 1,. , N:
Let X be the number of strings S1,. , Si-1 are equal to Si.
if X = 0 print Si.
if X (X > 0) print Si+(+X+), ... | Compilable |
For this Question: For two strings A and B, let A + B denote the concatenation of A and B in this order.
You are given N strings Si,. , SN. Modify and print them as follows, in the order i = 1,. , N:
Let X be the number of strings S1,. , Si-1 are equal to Si.
if X = 0 print Si.
if X (X > 0) print Si+(+X+), ... | Compilable |
For this Question: For two strings A and B, let A + B denote the concatenation of A and B in this order.
You are given N strings Si,. , SN. Modify and print them as follows, in the order i = 1,. , N:
Let X be the number of strings S1,. , Si-1 are equal to Si.
if X = 0 print Si.
if X (X > 0) print Si+(+X+), ... | Compilable |
For this Question: Given a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b... | Compilable |
For this Question: Given a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b... | Compilable |
For this Question: You will be given a <code>list of employees</code> with their information in a <code>JSON format as an argument</code>. Your task is to implement a JavaScript function, <code>performEmployeeOperations</code>, that performs the following tasks:
<ol>
<li>Find the <code>employee with the highest sal... | Compilable |
For this Question: Find number of ways an integer N can be represented as a sum of unique natural numbers.First line contain an integer T denoting number of test cases. Each test case contains a single integer N.
Constraint:-
1 <= T <= 100
0 <= N <= 120Print a single integer containing number of ways.Sample input
... | Compilable |
For this Question: Find number of ways an integer N can be represented as a sum of unique natural numbers.First line contain an integer T denoting number of test cases. Each test case contains a single integer N.
Constraint:-
1 <= T <= 100
0 <= N <= 120Print a single integer containing number of ways.Sample input
... | Compilable |
For this Question: Find number of ways an integer N can be represented as a sum of unique natural numbers.First line contain an integer T denoting number of test cases. Each test case contains a single integer N.
Constraint:-
1 <= T <= 100
0 <= N <= 120Print a single integer containing number of ways.Sample input
... | Compilable |
For this Question: Find number of ways an integer N can be represented as a sum of unique natural numbers.First line contain an integer T denoting number of test cases. Each test case contains a single integer N.
Constraint:-
1 <= T <= 100
0 <= N <= 120Print a single integer containing number of ways.Sample input
... | 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: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.
Co... | Compilable |
For this Question: A string is called square if it is some string written twice in a row. For example, the strings "aa", "abcabc", "abab" and "baabaa" are square. But the strings "aaa", "abaaab" and "abcdabc" are not square. For a given string s determine if it is square.The input consists of a string S consisting of l... | Compilable |
For this Question: Given a reference to the head of a sorted doubly-linked list and an integer k, your task is to insert the integer k in your doubly linked-list while maintaining the sort.<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... | Compilable |
For this Question: Given an array of N strings, find the longest common prefix among all strings present in the array.The fist line of each test contains a single integer N. Next line has space-separated N strings.
Constraints:-
1 <= N <= 10^3
1 <= |S| <= 10^3
Print the longest common prefix as a string in the gi... | Compilable |
For this Question: Given an array of N strings, find the longest common prefix among all strings present in the array.The fist line of each test contains a single integer N. Next line has space-separated N strings.
Constraints:-
1 <= N <= 10^3
1 <= |S| <= 10^3
Print the longest common prefix as a string in the gi... | Compilable |
For this Question: Given an array of N strings, find the longest common prefix among all strings present in the array.The fist line of each test contains a single integer N. Next line has space-separated N strings.
Constraints:-
1 <= N <= 10^3
1 <= |S| <= 10^3
Print the longest common prefix as a string in the gi... | Compilable |
For this Question: Given an array of N strings, find the longest common prefix among all strings present in the array.The fist line of each test contains a single integer N. Next line has space-separated N strings.
Constraints:-
1 <= N <= 10^3
1 <= |S| <= 10^3
Print the longest common prefix as a string in the gi... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed.
Given initial pos... | Compilable |
For this Question: Given an 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: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:-
1 2 3 5 1 5 9 1 2 8
Sample Output:-
1 2 3 5 9 8
<b>Explanation:-</b>
Extra 1, 2, and 5 were removed since they were occurring mu... | Compilable |
For this Question: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:-
1 2 3 5 1 5 9 1 2 8
Sample Output:-
1 2 3 5 9 8
<b>Explanation:-</b>
Extra 1, 2, and 5 were removed since they were occurring mu... | Compilable |
For this Question: Given a binary tree of N nodes, with root 1 and Q queries with nodes u and v. For each query find the sum of nodes on the shortest path from u to v, where node v is the ancestor of node u.First line contains the integer N and Q, denoting the number of nodes in the binary tree and the number of querie... | Compilable |
For this Question: Given a binary tree of N nodes, with root 1 and Q queries with nodes u and v. For each query find the sum of nodes on the shortest path from u to v, where node v is the ancestor of node u.First line contains the integer N and Q, denoting the number of nodes in the binary tree and the number of querie... | Compilable |
For this Question: Given a binary matrix, your task is to calculate the maximum area of a rectangle formed by only 1's in it.First line contains two integers number of rows N and number of columns M.
Next N lines contain M integers with each integer being either 0 or 1
Constraints:-
1 <= N, M <=1000Print the maxim... | Compilable |
For this Question: Given a binary matrix, your task is to calculate the maximum area of a rectangle formed by only 1's in it.First line contains two integers number of rows N and number of columns M.
Next N lines contain M integers with each integer being either 0 or 1
Constraints:-
1 <= N, M <=1000Print the maxim... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Given a binary sorted non-increasing array arr of size <b>N</b>. You need to print the count of <b>1's</b> in the binary array.
Try to solve the problem using binary searchThe input line contains T, denotes the number of testcases.
Each test case contains two lines. The first line contains N (si... | Compilable |
For this Question: Given a number N, your task is to find if it is a perfect square or not.The first line of input contains the number of test cases T, the next T lines contains a single integer N.
<b>Constraints:</b>
1 < = T < = 1000
1 < = N < = 10<sup>12</sup>For each test case, print "YES" if the number N is a ... | Compilable |
For this Question: Given a number N, your task is to find if it is a perfect square or not.The first line of input contains the number of test cases T, the next T lines contains a single integer N.
<b>Constraints:</b>
1 < = T < = 1000
1 < = N < = 10<sup>12</sup>For each test case, print "YES" if the number N is a ... | Compilable |
For this Question: Given a number N, your task is to find if it is a perfect square or not.The first line of input contains the number of test cases T, the next T lines contains a single integer N.
<b>Constraints:</b>
1 < = T < = 1000
1 < = N < = 10<sup>12</sup>For each test case, print "YES" if the number N is a ... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: Given an array of N elements. In the array, each element is present twice except for 1 element whose frequency in the array is 1. Hence the length of the array will always be odd.
Find the unique number.An integer, N, representing the size of the array. In the next line, N space-separated integers f... | Compilable |
For this Question: Given an array of N elements. In the array, each element is present twice except for 1 element whose frequency in the array is 1. Hence the length of the array will always be odd.
Find the unique number.An integer, N, representing the size of the array. In the next line, N space-separated integers f... | Compilable |
For this Question: Given an array of N elements. In the array, each element is present twice except for 1 element whose frequency in the array is 1. Hence the length of the array will always be odd.
Find the unique number.An integer, N, representing the size of the array. In the next line, N space-separated integers f... | Compilable |
For this Question: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:-
1 2 3 5 1 5 9 1 2 8
Sample Output:-
1 2 3 5 9 8
<b>Explanation:-</b>
Extra 1, 2, and 5 were removed since they were occurring mu... | Compilable |
For this Question: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:-
1 2 3 5 1 5 9 1 2 8
Sample Output:-
1 2 3 5 9 8
<b>Explanation:-</b>
Extra 1, 2, and 5 were removed since they were occurring mu... | 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 a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b... | Compilable |
For this Question: Given a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b... | Compilable |
For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answe... | Compilable |
For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answe... | Compilable |
For this Question: A child is running up a staircase with n steps and can hop either 1 step, 2 steps or 3 steps at a time. Implement a method to count how many possible ways the child can run-up to the stairs. You need to return all possible number of ways.
The time complexity of your code should be O(n).
Print answe... | 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: While Solo was enjoying her daddy's party, her little sister Tono gave her the following problem to solve:
Given an array A of N integers, find the number of occurrences of the maximum integer in the array.
As Solo is small and enjoying the party, please help her solve this problem.The first line... | Compilable |
For this Question: While Solo was enjoying her daddy's party, her little sister Tono gave her the following problem to solve:
Given an array A of N integers, find the number of occurrences of the maximum integer in the array.
As Solo is small and enjoying the party, please help her solve this problem.The first line... | Compilable |
For this Question: While Solo was enjoying her daddy's party, her little sister Tono gave her the following problem to solve:
Given an array A of N integers, find the number of occurrences of the maximum integer in the array.
As Solo is small and enjoying the party, please help her solve this problem.The first line... | Compilable |
For this Question: You are given resistance value of N resistors. Find the net resistance of the system when all of these N resistors are connected in parallel.
If there are three resistors A1, A2, A3, when they are connected in parallel, the net resistance will be 1/((1/A1) + (1/A2) + (1/A3))
Since this number c... | Compilable |
For this Question: You are given resistance value of N resistors. Find the net resistance of the system when all of these N resistors are connected in parallel.
If there are three resistors A1, A2, A3, when they are connected in parallel, the net resistance will be 1/((1/A1) + (1/A2) + (1/A3))
Since this number c... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.