Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
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: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow.
Each testcase contains one line of input containing the string S.
... | Compilable |
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow.
Each testcase contains one line of input containing the string S.
... | Compilable |
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow.
Each testcase contains one line of input containing the string S.
... | Compilable |
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow.
Each testcase contains one line of input containing the string S.
... | Compilable |
For this Question: You are given a number n. You need to find the count of digits in n.The first line of input contains T denoting the number of test cases. Each testcase contains one line of input containing n.
For Python, Language Just Completes the function.
<b>Constraints:</b>
1 ≤ T ≤ 100
1 ≤ n ≤ ... | Compilable |
For this Question: You are given a number n. You need to find the count of digits in n.The first line of input contains T denoting the number of test cases. Each testcase contains one line of input containing n.
For Python, Language Just Completes the function.
<b>Constraints:</b>
1 ≤ T ≤ 100
1 ≤ n ≤ ... | Compilable |
For this Question: You are given a number n. You need to find the count of digits in n.The first line of input contains T denoting the number of test cases. Each testcase contains one line of input containing n.
For Python, Language Just Completes the function.
<b>Constraints:</b>
1 ≤ T ≤ 100
1 ≤ n ≤ ... | 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: In number theory, the totient Q(N) of a positive integer N is defined as the number of positive integers less than or equal to N that are co-prime to N.
Given an integer N. Compute the value of the totient Q(N) .First line contain integer t denoting number of test cases.
Next t lines contains an ... | Compilable |
For this Question: In number theory, the totient Q(N) of a positive integer N is defined as the number of positive integers less than or equal to N that are co-prime to N.
Given an integer N. Compute the value of the totient Q(N) .First line contain integer t denoting number of test cases.
Next t lines contains an ... | Compilable |
For this Question: In number theory, the totient Q(N) of a positive integer N is defined as the number of positive integers less than or equal to N that are co-prime to N.
Given an integer N. Compute the value of the totient Q(N) .First line contain integer t denoting number of test cases.
Next t lines contains an ... | Compilable |
For this Question: You are given a 2X2 square matrix. You need to find the determinant of the matrix.The input contains two-line, each line contain two integers separated by spaces.
Each element of the matrix is from 1 to 100.Output a single integer, the determinant of the matrix.Sample Input
4 5
2 3
Sample Out... | Compilable |
For this Question: You are given a 2X2 square matrix. You need to find the determinant of the matrix.The input contains two-line, each line contain two integers separated by spaces.
Each element of the matrix is from 1 to 100.Output a single integer, the determinant of the matrix.Sample Input
4 5
2 3
Sample Out... | Compilable |
For this Question: You are given a 2X2 square matrix. You need to find the determinant of the matrix.The input contains two-line, each line contain two integers separated by spaces.
Each element of the matrix is from 1 to 100.Output a single integer, the determinant of the matrix.Sample Input
4 5
2 3
Sample Out... | 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: 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 a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not.
<b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a... | Compilable |
For this Question: Given an integer <b>N</b>, you need to typecast this integer to String. If the typecasting is done successfully then we will print "<b>Nice Job</b>" otherwise "<b>Wrong answer</b>".User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the fu... | Compilable |
For this Question: Given an integer <b>N</b>, you need to typecast this integer to String. If the typecasting is done successfully then we will print "<b>Nice Job</b>" otherwise "<b>Wrong answer</b>".User task:
Since this is a functional problem you don't have to worry about the input. You just have to complete the fu... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Given a string S, find the number of occurrences of its smallest character.Input contains a single string S.
Constraints:
1 <= |S| <= 100000
S contains english lowercase letters.Print the number of occurrences of smallest character of S.Sample Input
abcda
Sample Output
2
Explanation: Sma... | Compilable |
For this Question: Given a string S, find the number of occurrences of its smallest character.Input contains a single string S.
Constraints:
1 <= |S| <= 100000
S contains english lowercase letters.Print the number of occurrences of smallest character of S.Sample Input
abcda
Sample Output
2
Explanation: Sma... | Compilable |
For this Question: Given a string S, find the number of occurrences of its smallest character.Input contains a single string S.
Constraints:
1 <= |S| <= 100000
S contains english lowercase letters.Print the number of occurrences of smallest character of S.Sample Input
abcda
Sample Output
2
Explanation: Sma... | Compilable |
For this Question: You are given an array a that contains N integers. All the integers in the array may not be distinct. The number of repetitions of each integer in the array is represented by ri. Your task is to print the integers in the decreasing order of their occurrence in the array.
Note
1. If ri > rj, then... | Compilable |
For this Question: You are given an array a that contains N integers. All the integers in the array may not be distinct. The number of repetitions of each integer in the array is represented by ri. Your task is to print the integers in the decreasing order of their occurrence in the array.
Note
1. If ri > rj, then... | Compilable |
For this Question: You are given an array a that contains N integers. All the integers in the array may not be distinct. The number of repetitions of each integer in the array is represented by ri. Your task is to print the integers in the decreasing order of their occurrence in the array.
Note
1. If ri > rj, then... | Compilable |
For this Question: You are given a string S of length N. Find the character which occurs the most number of times in this string. If there are mutliple such characters present, print -1.The first line of the input contains a single integer N.
The second line of the input contains a string S.
<b>Constraints:</b>
2 ... | Compilable |
For this Question: You are given a string S of length N. Find the character which occurs the most number of times in this string. If there are mutliple such characters present, print -1.The first line of the input contains a single integer N.
The second line of the input contains a string S.
<b>Constraints:</b>
2 ... | Compilable |
For this Question: Given N and K, find the lexicographically smallest string of length N using only the first K lowercase letters of the alphabet such that each letter is used at least once and no two adjacent characters are equal.
If such a string doesn't exist, print -1.The first line of input contains a single i... | Compilable |
For this Question: Given N and K, find the lexicographically smallest string of length N using only the first K lowercase letters of the alphabet such that each letter is used at least once and no two adjacent characters are equal.
If such a string doesn't exist, print -1.The first line of input contains a single i... | Compilable |
For this Question: Given N and K, find the lexicographically smallest string of length N using only the first K lowercase letters of the alphabet such that each letter is used at least once and no two adjacent characters are equal.
If such a string doesn't exist, print -1.The first line of input contains a single i... | Compilable |
For this Question: Given an array A[] of size N containing non-negative integers. You have to move all 0's to the end of array while maintaining the relative order of the non-zero elements.
Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.The first line of... | Compilable |
For this Question: Given an array A[] of size N containing non-negative integers. You have to move all 0's to the end of array while maintaining the relative order of the non-zero elements.
Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.The first line of... | Compilable |
For this Question: Write a program to check whether a number is even or odd using switch case.First Line of the input contains the number n.
<b>Constraints</b>
1 <= n <= 1e9If the number is even print "Even" otherwise "Odd"Sample Input :
23
Sample Output :
Odd
Sample Input :
24
Sample Output :
Even,... | Compilable |
For this Question: Write a program to check whether a number is even or odd using switch case.First Line of the input contains the number n.
<b>Constraints</b>
1 <= n <= 1e9If the number is even print "Even" otherwise "Odd"Sample Input :
23
Sample Output :
Odd
Sample Input :
24
Sample Output :
Even,... | Compilable |
For this Question: Write a program to check whether a number is even or odd using switch case.First Line of the input contains the number n.
<b>Constraints</b>
1 <= n <= 1e9If the number is even print "Even" otherwise "Odd"Sample Input :
23
Sample Output :
Odd
Sample Input :
24
Sample Output :
Even,... | Compilable |
For this Question: You are given an unsorted array of length n and must sort it using merge sort while also printing the amount of merges that occur throughout the sorting process.The first line of input will be n, which represents the array's length, followed by the n array items in the second line.
Constraints:
0... | Compilable |
For this Question: You are given an unsorted array of length n and must sort it using merge sort while also printing the amount of merges that occur throughout the sorting process.The first line of input will be n, which represents the array's length, followed by the n array items in the second line.
Constraints:
0... | Compilable |
For this Question: Given a binary tree containing with N nodes and an integer X. Your task is to complete the function countSubtreesWithSumX() that returns the count of the number of subtress having total node’s data sum equal to a value X.
Example: A tree given below<b>User Task:</b>
Since this will be a functional... | Compilable |
For this Question: You're given a string S of lowercase letters of the english alphabet. Find whether you can choose some characters of the string S in any order to create the string "red".The first and the only line of input contains the string S.
Constraints
1 <= |S| <= 100
All the characters in S are lowercase ... | Compilable |
For this Question: You're given a string S of lowercase letters of the english alphabet. Find whether you can choose some characters of the string S in any order to create the string "red".The first and the only line of input contains the string S.
Constraints
1 <= |S| <= 100
All the characters in S are lowercase ... | Compilable |
For this Question: You're given a string S of lowercase letters of the english alphabet. Find whether you can choose some characters of the string S in any order to create the string "red".The first and the only line of input contains the string S.
Constraints
1 <= |S| <= 100
All the characters in S are lowercase ... | Compilable |
For this Question: A string is called amicable if there is no character in the string which appears exactly once. For example, "abcccba" is amicable, whereas "abcba" is not amicable as the character 'c' appears only once. Your task is to find the total number of amicable substrings of a given string S.
Note:
Two su... | Compilable |
For this Question: A string is called amicable if there is no character in the string which appears exactly once. For example, "abcccba" is amicable, whereas "abcba" is not amicable as the character 'c' appears only once. Your task is to find the total number of amicable substrings of a given string S.
Note:
Two su... | 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 |
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 an array A of size N. Find the number of pairs of indices (i, j) in the array A such that i < j and A<sub>i</sub> - i = A<sub>j</sub> - j.The first line of the input contains a single integer N.
The second line of the input contains N space seperated integers.
Constraints:
1 <= N <... | Compilable |
For this Question: You are given a simple undirected graph consisting of N nodes and M edges. Count the number of distinct ways of removing a (possibly empty) subset of edges such that the <b>remaining graph on N nodes remains edge biconnected</b>.
<ul>
<li> A graph is said to be <b>edge biconnected</b> if, for every... | 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: 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: All countries by the year they first participated in the Olympics have to be ordered.
Output the National Olympics Committee (NOC) name along with the desired year.
Sort records by the year and the NOC in ascending order.DataFrame/SQL Table with the following schema -
<schema>[{'name': 'olympics_a... | Compilable |
For this Question: All countries by the year they first participated in the Olympics have to be ordered.
Output the National Olympics Committee (NOC) name along with the desired year.
Sort records by the year and the NOC in ascending order.DataFrame/SQL Table with the following schema -
<schema>[{'name': 'olympics_a... | Compilable |
For this Question: You are given a binary string S of length N. Suppose there is an integer K (1 <= K <= N). You can perform the following operation on the string any number of times (possible zero):
Select a substring in S whose size is <b>at least</b> K i. e, R − L + 1 >= K must be followed and flip this substring... | Compilable |
For this Question: You are given a binary string S of length N. Suppose there is an integer K (1 <= K <= N). You can perform the following operation on the string any number of times (possible zero):
Select a substring in S whose size is <b>at least</b> K i. e, R − L + 1 >= K must be followed and flip this substring... | Compilable |
For this Question: You have a list arr of all integers in the range [1, n] sorted in a strictly increasing order. Apply the following algorithm on arr:
:> Starting from left to right, remove the first number and every other number afterward until you reach the end of the list.
:> Repeat the previous step again, but... | Compilable |
For this Question: Given an sorted array <b>Arr[]</b> of size <b>N</b>, containing both <b>negative</b> and <b>positive</b> integers, you need to print the squared sorted output.
<b>Note</b> Try using two pointer approachThe first line of input contains T, denoting the number of test cases. Each testcase contains 2 ... | Compilable |
For this Question: Given an sorted array <b>Arr[]</b> of size <b>N</b>, containing both <b>negative</b> and <b>positive</b> integers, you need to print the squared sorted output.
<b>Note</b> Try using two pointer approachThe first line of input contains T, denoting the number of test cases. Each testcase contains 2 ... | 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: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements.
For ... | Compilable |
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements.
For ... | Compilable |
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements.
For ... | Compilable |
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements.
For ... | Compilable |
For this Question: Given a circular linked list consisting of N nodes and an integer K, your task is to add the integer K at the end of the list.
<b>Note:
Sample Input and Output just show how a linked list will look depending on the questions. Do not copy-paste as it is in custom input</b><b>User Task:</b>
Sinc... | 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: Given an array of N integers, an integer X, and Q queries. For each query, you will be given an integer K. Your task is to find the Kth occurrence of the number X in the array. If the Kth occurrence does not exist print -1.The first line of input contains three integers N, X, and Q. The second line o... | Compilable |
For this Question: Given an array of N integers, an integer X, and Q queries. For each query, you will be given an integer K. Your task is to find the Kth occurrence of the number X in the array. If the Kth occurrence does not exist print -1.The first line of input contains three integers N, X, and Q. The second line o... | Compilable |
For this Question: Given an array of N integers, an integer X, and Q queries. For each query, you will be given an integer K. Your task is to find the Kth occurrence of the number X in the array. If the Kth occurrence does not exist print -1.The first line of input contains three integers N, X, and Q. The second line o... | Compilable |
For this Question: You are given N flags, initially set to 0. Now you have to perform two operations on them:
1. Increase(F) by 1: flag F is increased by 1.
2. max_flag: all flags are set to a maximum value of any flag.
A non-empty array arr[] will be given of size M. This array represents consecutive operations:
... | Compilable |
For this Question: You are given N flags, initially set to 0. Now you have to perform two operations on them:
1. Increase(F) by 1: flag F is increased by 1.
2. max_flag: all flags are set to a maximum value of any flag.
A non-empty array arr[] will be given of size M. This array represents consecutive operations:
... | Compilable |
For this Question: Bob is at the origin of a number line. He wants to reach a goal at coordinate X.
There is a wall at coordinate Y, which Bob cannot go beyond at first. However, after picking up a hammer at coordinate Z, he can destroy that wall and pass through.
Determine whether Bob can reach the goal. If he can, ... | Compilable |
For this Question: Create a class Teacher with name, age, and salary attributes, where salary must be a private attribute that cannot be accessed outside the class.
Print the details of the teacher including salary.The first line contains the name, the second line contains the age and the third line contains the salar... | Compilable |
For this Question: Create a class Teacher with name, age, and salary attributes, where salary must be a private attribute that cannot be accessed outside the class.
Print the details of the teacher including salary.The first line contains the name, the second line contains the age and the third line contains the salar... | Compilable |
For this Question: Given an integer N, find the closest prime number to N. If there are multiple print the smaller one.The input contains a single integer N.
Constraints:
1 <= N <= 1000000000Print the closest prime to N.Sample Input 1
12
Sample Output 1
11
Explanation: Closest prime to 12 is 11 and 13 small... | Compilable |
For this Question: Given an integer N, find the closest prime number to N. If there are multiple print the smaller one.The input contains a single integer N.
Constraints:
1 <= N <= 1000000000Print the closest prime to N.Sample Input 1
12
Sample Output 1
11
Explanation: Closest prime to 12 is 11 and 13 small... | Compilable |
For this Question: Given an integer N, find the closest prime number to N. If there are multiple print the smaller one.The input contains a single integer N.
Constraints:
1 <= N <= 1000000000Print the closest prime to N.Sample Input 1
12
Sample Output 1
11
Explanation: Closest prime to 12 is 11 and 13 small... | Compilable |
For this Question: Given a String of length S, reverse the whole string without reversing the individual words in it. Words are separated by dots.First line of input contains T, number of testcases. Each testcase contains a string S containing characters.
Constraints:
1 <= T <= 100
1 <= |S| <= 10000For each test c... | Compilable |
For this Question: Given a String of length S, reverse the whole string without reversing the individual words in it. Words are separated by dots.First line of input contains T, number of testcases. Each testcase contains a string S containing characters.
Constraints:
1 <= T <= 100
1 <= |S| <= 10000For each test c... | Compilable |
For this Question: Numbers are awesome, the xor of them is more.
You are given an array A of N natural numbers. For each A[i], you need to find the Xor Value, A[i]^A[i+1]^A[i+2]^...^A[n].
Find the sum of Xor values for each element A[i].The first line of the input contains an integer N denoting the number of elements... | Compilable |
For this Question: Numbers are awesome, the xor of them is more.
You are given an array A of N natural numbers. For each A[i], you need to find the Xor Value, A[i]^A[i+1]^A[i+2]^...^A[n].
Find the sum of Xor values for each element A[i].The first line of the input contains an integer N denoting the number of elements... | Compilable |
For this Question: Numbers are awesome, the xor of them is more.
You are given an array A of N natural numbers. For each A[i], you need to find the Xor Value, A[i]^A[i+1]^A[i+2]^...^A[n].
Find the sum of Xor values for each element A[i].The first line of the input contains an integer N denoting the number of elements... | Compilable |
For this Question: Emily was playing with triplets. She was excited to find out how many triples of non-negative integers (a, b, c) satisfy a+b+c≤S and a×b×c≤T, where S & T are non-negative integers.The input line contains S, and T separated by space.
<b>Constraints</b>
0≤S≤100
0≤T≤10000
S and T are i... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.