Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
For this Question: Sid is super fascinated with Fibonacci numbers. Since he thinks a lot about Fibonacci numbers, this time he has come up with a strange problem on them, specially designed for you. As usual, he will give you a chapo if you can manage to solve this problem.
You are given four integers x, y, a, b. You ... | 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: 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: 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: Given two elements A and B, your task is to swap the given two elements.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Swap(int A, int B)</b>.Print one line which contains the output of swapped elements.Sample Input:... | Compilable |
For this Question: Given two elements A and B, your task is to swap the given two elements.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>Swap(int A, int B)</b>.Print one line which contains the output of swapped elements.Sample Input:... | Compilable |
For this Question: You are given a Doubly linked list and an integer K . Your task is to insert the integer K at the head of the given linked list<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>insertnew()</b> that takes the head node ... | Compilable |
For this Question: Chef is playing with a number N. If the total number of set bits in N is even then Chef is happy. Determine whether Chef is happy or not.first line contain a single integer N.if the total number of set bits in N is even print "Yes" otherwise print "No"Sample Input 1:
7
Sample Output 1:
NO
Sam... | Compilable |
For this Question: Chef is playing with a number N. If the total number of set bits in N is even then Chef is happy. Determine whether Chef is happy or not.first line contain a single integer N.if the total number of set bits in N is even print "Yes" otherwise print "No"Sample Input 1:
7
Sample Output 1:
NO
Sam... | Compilable |
For this Question: Chef is playing with a number N. If the total number of set bits in N is even then Chef is happy. Determine whether Chef is happy or not.first line contain a single integer N.if the total number of set bits in N is even print "Yes" otherwise print "No"Sample Input 1:
7
Sample Output 1:
NO
Sam... | 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: In an exam of JEE one aspirant got P correct answers, Q wrong answer, and R unattempted question. If the mark for the correct answer is 4, for the wrong answer is -2, and for the unattempted questions is -1. Find the final marks the aspirant got.<b>User Task:</b>
Since this will be a functional prob... | Compilable |
For this Question: In an exam of JEE one aspirant got P correct answers, Q wrong answer, and R unattempted question. If the mark for the correct answer is 4, for the wrong answer is -2, and for the unattempted questions is -1. Find the final marks the aspirant got.<b>User Task:</b>
Since this will be a functional prob... | Compilable |
For this Question: In an exam of JEE one aspirant got P correct answers, Q wrong answer, and R unattempted question. If the mark for the correct answer is 4, for the wrong answer is -2, and for the unattempted questions is -1. Find the final marks the aspirant got.<b>User Task:</b>
Since this will be a functional prob... | Compilable |
For this Question: In an exam of JEE one aspirant got P correct answers, Q wrong answer, and R unattempted question. If the mark for the correct answer is 4, for the wrong answer is -2, and for the unattempted questions is -1. Find the final marks the aspirant got.<b>User Task:</b>
Since this will be a functional prob... | Compilable |
For this Question: There are N robots standing in a row. Ultron wants to delegate a task of difficulty X to two of them. Each robot has its own ability, A[i] for the i<sup>th</sup> robot from the left. The task can only be completed if the sum of the abilities of the two robots is exactly equal to X. Ultron wants to fi... | Compilable |
For this Question: Create a basic table namely TEST_TABLE with 1 field TEST_FIELD as int.
( USE ONLY UPPER CASE LETTERS )
<schema>[{'name': 'TEST_TABLE', 'columns': [{'name': 'TEST_FIELD', 'type': 'INT'}]}]</schema>nannannan, I have written this Solution Code: CREATE TABLE TEST_TABLE (
TEST_FIELD INT
);, In this ... | 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: 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: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: For a given positive integer N, determine if there exist three <b>positive</b> integers a, b and c such that the following two conditions hold:
1. a + b + c = N
2. a ^ b ^ c = 0 where ^ denotes the bitwise XOR operation.
If there exist such a triple (a, b, c), print the lexicographically small... | Compilable |
For this Question: The flower shop near his house sells flowers of N types. It is found that the store has Ai flowers of the i-th type. We like odd numbers. Therefore, we have decided that there should be an odd number of flowers of each type in the bouquet, and the total number of flowers in the bouquet should also be... | Compilable |
For this Question: The flower shop near his house sells flowers of N types. It is found that the store has Ai flowers of the i-th type. We like odd numbers. Therefore, we have decided that there should be an odd number of flowers of each type in the bouquet, and the total number of flowers in the bouquet should also be... | Compilable |
For this Question: The flower shop near his house sells flowers of N types. It is found that the store has Ai flowers of the i-th type. We like odd numbers. Therefore, we have decided that there should be an odd number of flowers of each type in the bouquet, and the total number of flowers in the bouquet should also be... | Compilable |
For this Question: Given an integer array A of size N. Find the sum of GCD (Greatest Common Divisor) of all elements with their frequency.First line contains an integers N.
Next line contains N space separated integers denoting elements of array.
Constraints
1 <= N <= 1000
0 <= Ai<= 10^5Print the sum of GCD of al... | Compilable |
For this Question: Given an integer array A of size N. Find the sum of GCD (Greatest Common Divisor) of all elements with their frequency.First line contains an integers N.
Next line contains N space separated integers denoting elements of array.
Constraints
1 <= N <= 1000
0 <= Ai<= 10^5Print the sum of GCD of al... | Compilable |
For this Question: Given an integer array A of size N. Find the sum of GCD (Greatest Common Divisor) of all elements with their frequency.First line contains an integers N.
Next line contains N space separated integers denoting elements of array.
Constraints
1 <= N <= 1000
0 <= Ai<= 10^5Print the sum of GCD of al... | Compilable |
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: Doctor Strange stumbles upon a rather curious artefact while spending holidays in Egypt. An antique board game but it can only be unlocked by a magical die. The only clue on the box is to get a sum of B by throwing the die A times. Help Doctor Strange if it is possible to get the particular sum. Prin... | Compilable |
For this Question: For a certain event, the value of a favorable outcome is A and the total outcome is B. If the probability of this event is represented by p/q where p and q are coprime then what will be the value of p+q.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just... | Compilable |
For this Question: For a certain event, the value of a favorable outcome is A and the total outcome is B. If the probability of this event is represented by p/q where p and q are coprime then what will be the value of p+q.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just... | Compilable |
For this Question: For a certain event, the value of a favorable outcome is A and the total outcome is B. If the probability of this event is represented by p/q where p and q are coprime then what will be the value of p+q.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just... | Compilable |
For this Question: For a certain event, the value of a favorable outcome is A and the total outcome is B. If the probability of this event is represented by p/q where p and q are coprime then what will be the value of p+q.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just... | Compilable |
For this Question: Given a morse code, Your task is to figure out the exact words from it.
Morse Code Dictionary :
dict = {".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..", "L": "--", "M": "-.", "N": "---", "O": ".--.": "P", "... | Compilable |
For this Question: Given a morse code, Your task is to figure out the exact words from it.
Morse Code Dictionary :
dict = {".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..", "L": "--", "M": "-.", "N": "---", "O": ".--.": "P", "... | Compilable |
For this Question: Given a morse code, Your task is to figure out the exact words from it.
Morse Code Dictionary :
dict = {".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..", "L": "--", "M": "-.", "N": "---", "O": ".--.": "P", "... | Compilable |
For this Question: You are given an array A of N integers. You can perform the following operation as many times as you like:-
Choose two indices i and j (1 <= i < j <= N), replace A[i] by A[i] OR A[j] and replace A[j] by A[i] AND A[j]. (where OR and AND are logical operators).
All you need to do is find the maximu... | Compilable |
For this Question: You are given an array A of N integers. You can perform the following operation as many times as you like:-
Choose two indices i and j (1 <= i < j <= N), replace A[i] by A[i] OR A[j] and replace A[j] by A[i] AND A[j]. (where OR and AND are logical operators).
All you need to do is find the maximu... | Compilable |
For this Question: Sara does not like strings which have both the uppercase and the lowercase characters. She thinks only those strings are good which have only lowercase characters(a-z) or only uppercase characters(A-Z).
Given a string s consisting of english alphabets. Find the minimum number of operations require... | Compilable |
For this Question: Sara does not like strings which have both the uppercase and the lowercase characters. She thinks only those strings are good which have only lowercase characters(a-z) or only uppercase characters(A-Z).
Given a string s consisting of english alphabets. Find the minimum number of operations require... | Compilable |
For this Question: Sara does not like strings which have both the uppercase and the lowercase characters. She thinks only those strings are good which have only lowercase characters(a-z) or only uppercase characters(A-Z).
Given a string s consisting of english alphabets. Find the minimum number of operations require... | Compilable |
For this Question: Given two positive integers N and M. The task is to check whether N is a <b>Special-M-visor</b> or not.
<b>Special-M-visor</b>: A number is called Special-m-visor if it has exactly M even divisors for a given N.<b>User Task:</b>
Since this is a functional problem, you don’t have to worry about the ... | Compilable |
For this Question: Given two positive integers N and M. The task is to check whether N is a <b>Special-M-visor</b> or not.
<b>Special-M-visor</b>: A number is called Special-m-visor if it has exactly M even divisors for a given N.<b>User Task:</b>
Since this is a functional problem, you don’t have to worry about the ... | Compilable |
For this Question: Given two positive integers N and M. The task is to check whether N is a <b>Special-M-visor</b> or not.
<b>Special-M-visor</b>: A number is called Special-m-visor if it has exactly M even divisors for a given N.<b>User Task:</b>
Since this is a functional problem, you don’t have to worry about the ... | Compilable |
For this Question: Given two positive integers N and M. The task is to check whether N is a <b>Special-M-visor</b> or not.
<b>Special-M-visor</b>: A number is called Special-m-visor if it has exactly M even divisors for a given N.<b>User Task:</b>
Since this is a functional problem, you don’t have to worry about the ... | Compilable |
For this Question: Given a number N, find the sum of all the digits of the number
Note: Use a recursive method to solve this problem.<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>Sum()</b> that takes the integer N as a parameter.
... | Compilable |
For this Question: Given a number N, find the sum of all the digits of the number
Note: Use a recursive method to solve this problem.<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>Sum()</b> that takes the integer N as a parameter.
... | Compilable |
For this Question: Given an integer n holding some random value, your task is to assign value 10 to the given integer.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>Assignment_Operator()</b>, which takes no parameter.
<b>Constraints:<... | Compilable |
For this Question: Write a program to check whether character is an alphabet or not using conditional operator.The first line of the input contains a character ch.
<b>Constraints</b>
'a', 'A' <= ch <= 'z', 'Z'Print "YES" if it's alphabet otherwise "NO".Sample Input :
a
Sample Output
YES, I have written this So... | Compilable |
For this Question: Write a program to check whether character is an alphabet or not using conditional operator.The first line of the input contains a character ch.
<b>Constraints</b>
'a', 'A' <= ch <= 'z', 'Z'Print "YES" if it's alphabet otherwise "NO".Sample Input :
a
Sample Output
YES, I have written this So... | Compilable |
For this Question: Write a program to check whether character is an alphabet or not using conditional operator.The first line of the input contains a character ch.
<b>Constraints</b>
'a', 'A' <= ch <= 'z', 'Z'Print "YES" if it's alphabet otherwise "NO".Sample Input :
a
Sample Output
YES, I have written this So... | Compilable |
For this Question: Given an integer N, find the sum of i*j for each pair (i, j) such that 1 <= i < j <= N.
Since the answer can be large, output it modulo 10<sup>9</sup>+7.The first and the only line of the input contains an integer N.
Constraints
2 <= N <= 200000Output a single integer, the answer to the above ... | Compilable |
For this Question: Given an integer N, find the sum of i*j for each pair (i, j) such that 1 <= i < j <= N.
Since the answer can be large, output it modulo 10<sup>9</sup>+7.The first and the only line of the input contains an integer N.
Constraints
2 <= N <= 200000Output a single integer, the answer to the above ... | Compilable |
For this Question: Given an integer N, find the sum of i*j for each pair (i, j) such that 1 <= i < j <= N.
Since the answer can be large, output it modulo 10<sup>9</sup>+7.The first and the only line of the input contains an integer N.
Constraints
2 <= N <= 200000Output a single integer, the answer to the above ... | 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 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: There is a rule in ludo that a token can only be unlocked when either a 1 or 6 shown in the die. Given the die number N, Your task is to check whether the token can be unlocked or not.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete t... | Compilable |
For this Question: There is a rule in ludo that a token can only be unlocked when either a 1 or 6 shown in the die. Given the die number N, Your task is to check whether the token can be unlocked or not.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete t... | Compilable |
For this Question: There is a rule in ludo that a token can only be unlocked when either a 1 or 6 shown in the die. Given the die number N, Your task is to check whether the token can be unlocked or not.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete t... | Compilable |
For this Question: There is a rule in ludo that a token can only be unlocked when either a 1 or 6 shown in the die. Given the die number N, Your task is to check whether the token can be unlocked or not.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete t... | Compilable |
For this Question: <b> The only difference between the easy and the tricky version is the constraint on the number of queries Q. Solving the tricky version automatically solves the easy version.</b>
You are given an array A of N integers. You will be given Q queries with two integers L and R. For each query, you ne... | Compilable |
For this Question: <b> The only difference between the easy and the tricky version is the constraint on the number of queries Q. Solving the tricky version automatically solves the easy version.</b>
You are given an array A of N integers. You will be given Q queries with two integers L and R. For each query, you ne... | Compilable |
For this Question: <b> The only difference between the easy and the tricky version is the constraint on the number of queries Q. Solving the tricky version automatically solves the easy version.</b>
You are given an array A of N integers. You will be given Q queries with two integers L and R. For each query, you ne... | Compilable |
For this Question: Given a linked list consisting of N nodes, your task is to check if the given list is palindrome or not.
A palindrome is a string/number that mirrors itself, for example, 21312 reverse is also 21312.User task:
Since this will be a functional problem, you don't have to take input. You just have to... | Compilable |
For this Question: Given a linked list consisting of N nodes, your task is to check if the given list is palindrome or not.
A palindrome is a string/number that mirrors itself, for example, 21312 reverse is also 21312.User task:
Since this will be a functional problem, you don't have to take input. You just have to... | 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: 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: For a given number N, Consider a table of N X N in which elements at the intersection of ith row and jth column are the product of i and j, i. e i x j.
Also given a positive integer X. Your task is to count the number of elements in the table that contain the integer X.<b>User Task:</b>
Since this... | Compilable |
For this Question: For a given number N, Consider a table of N X N in which elements at the intersection of ith row and jth column are the product of i and j, i. e i x j.
Also given a positive integer X. Your task is to count the number of elements in the table that contain the integer X.<b>User Task:</b>
Since this... | Compilable |
For this Question: For a given number N, Consider a table of N X N in which elements at the intersection of ith row and jth column are the product of i and j, i. e i x j.
Also given a positive integer X. Your task is to count the number of elements in the table that contain the integer X.<b>User Task:</b>
Since this... | Compilable |
For this Question: For a given number N, Consider a table of N X N in which elements at the intersection of ith row and jth column are the product of i and j, i. e i x j.
Also given a positive integer X. Your task is to count the number of elements in the table that contain the integer X.<b>User Task:</b>
Since this... | Compilable |
For this Question: You are given a matrix of characters. The matrix has N rows and M columns. Given a string s, you have to tell if it is possible to generate that string from given matrix.
Rules for generating string from matrix are:
You have to pick first character of string from row 1, second character from row ... | Compilable |
For this Question: You are given a matrix of characters. The matrix has N rows and M columns. Given a string s, you have to tell if it is possible to generate that string from given matrix.
Rules for generating string from matrix are:
You have to pick first character of string from row 1, second character from row ... | Compilable |
For this Question: You are given 2 numbers a, b.
You can perform at most b steps
In one step :
1- increase a by 3
2- decrease a by 3
3- multiply a by 2
Find number of distinct numbers we can make after performing at most b operations on a.The first line contains the number of tests T.
For each test case:... | Compilable |
For this Question: You are given 2 numbers a, b.
You can perform at most b steps
In one step :
1- increase a by 3
2- decrease a by 3
3- multiply a by 2
Find number of distinct numbers we can make after performing at most b operations on a.The first line contains the number of tests T.
For each test case:... | Compilable |
For this Question: You are given 2 numbers a, b.
You can perform at most b steps
In one step :
1- increase a by 3
2- decrease a by 3
3- multiply a by 2
Find number of distinct numbers we can make after performing at most b operations on a.The first line contains the number of tests T.
For each test case:... | 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: Given an array <b>nums</b> of N integers where each element is in between 1 to N. Your task is to print all the integers from 1 to N which are not present in the given array.First line contains n the length of input
Second line of input contains the array of integers in range from (1 to n)
<b> Co... | Compilable |
For this Question: Given an array <b>nums</b> of N integers where each element is in between 1 to N. Your task is to print all the integers from 1 to N which are not present in the given array.First line contains n the length of input
Second line of input contains the array of integers in range from (1 to n)
<b> Co... | Compilable |
For this Question: Given a binary array A[] of size N. The task is to arrange an array in increasing order.
(O(N) time complexity solution)Every test case contains two lines, first line contains an integer N (size of array) and second line contains space separated elements of array.
1 <= N <= 20
0 <= A[i] <= 1Prin... | Compilable |
For this Question: Given a binary array A[] of size N. The task is to arrange an array in increasing order.
(O(N) time complexity solution)Every test case contains two lines, first line contains an integer N (size of array) and second line contains space separated elements of array.
1 <= N <= 20
0 <= A[i] <= 1Prin... | Compilable |
For this Question: Given a binary array A[] of size N. The task is to arrange an array in increasing order.
(O(N) time complexity solution)Every test case contains two lines, first line contains an integer N (size of array) and second line contains space separated elements of array.
1 <= N <= 20
0 <= A[i] <= 1Prin... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.