Instruction
stringlengths
261
35k
Response
stringclasses
1 value
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: Given an ArrayList of N lowercase characters. The task is to insert given elements in the list and count frequency of elements present in the list. You can use some inbuilt functions as:- add() to append element in the list contains() to check an element is present or not in the list collecti...
Compilable
For this Question: You are given a cubic dice with 6 faces. All the individual faces have numbers printed on them. The numbers are in the range of 1 to 6, like any <b>ordinary dice</b>. You will be provided with a face of this cube, your task is to find the number on the opposite face of the cube. <b>Note</b>:- The ...
Compilable
For this Question: You are given a cubic dice with 6 faces. All the individual faces have numbers printed on them. The numbers are in the range of 1 to 6, like any <b>ordinary dice</b>. You will be provided with a face of this cube, your task is to find the number on the opposite face of the cube. <b>Note</b>:- The ...
Compilable
For this Question: You are given a cubic dice with 6 faces. All the individual faces have numbers printed on them. The numbers are in the range of 1 to 6, like any <b>ordinary dice</b>. You will be provided with a face of this cube, your task is to find the number on the opposite face of the cube. <b>Note</b>:- The ...
Compilable
For this Question: You are given a cubic dice with 6 faces. All the individual faces have numbers printed on them. The numbers are in the range of 1 to 6, like any <b>ordinary dice</b>. You will be provided with a face of this cube, your task is to find the number on the opposite face of the cube. <b>Note</b>:- The ...
Compilable
For this Question: There are N places, numbered 1,2,…,N. For each i (1≤i≤N), the height of place i is hi. There is a man who is initially on place 1. He will repeat the following action some number of times to reach place N: If the man is currently at place i, he will go to place i+1 or place i+2 i.e. maximum 2 jumps...
Compilable
For this Question: There are N places, numbered 1,2,…,N. For each i (1≤i≤N), the height of place i is hi. There is a man who is initially on place 1. He will repeat the following action some number of times to reach place N: If the man is currently at place i, he will go to place i+1 or place i+2 i.e. maximum 2 jumps...
Compilable
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well). Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y...
Compilable
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well). Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y...
Compilable
For this Question: Rick has got a huge candy bag. The bag contains a total of O orange candies, A apple candies, and U candies with an unknown flavor (can be orange or apple as well). Now Morty wants to know the maximum number of candies that can be drawn from the bag blindfolded such that no more than X orange and Y...
Compilable
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S. C...
Compilable
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S. C...
Compilable
For this Question: Given a string S. Two position i and j of the string are friends if they have the same character. The distance between two friends at positions i and j is defined as |i- j|. Find the sum of distances of all the pairs of friends in the given strings.First line of input contains a single string S. C...
Compilable
For this Question: Given a binary tree, with root 1, print the inorder traversal of the tree. Algorithm Inorder(tree) 1. Traverse the left subtree 2. Visit the root. 3. Traverse the right subtreeThe input consists of N+1 lines. First line contains the integer N, denoting the number of nodes in the binary...
Compilable
For this Question: Given a binary tree, with root 1, print the inorder traversal of the tree. Algorithm Inorder(tree) 1. Traverse the left subtree 2. Visit the root. 3. Traverse the right subtreeThe input consists of N+1 lines. First line contains the integer N, denoting the number of nodes in the binary...
Compilable
For this Question: Given a binary tree, with root 1, print the inorder traversal of the tree. Algorithm Inorder(tree) 1. Traverse the left subtree 2. Visit the root. 3. Traverse the right subtreeThe input consists of N+1 lines. First line contains the integer N, denoting the number of nodes in the binary...
Compilable
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d...
Compilable
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d...
Compilable
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d...
Compilable
For this Question: Given a double linked list consisting of N nodes, your task is to reverse the linked list and return the head of the modified 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>Reverse()</b> that takes head node of ...
Compilable
For this Question: You are given N intervals, the i<sup>th</sup> of them being [A<sub>i</sub>, B<sub>i</sub>], where A<sub>i</sub> and B<sub>i</sub> are positive integers. Let the union of all these intervals be S. It is easy to see that S can be uniquely represented as an union of disjoint closed intervals. Your task ...
Compilable
For this Question: There are n people participating in some contest, they start participating in x minutes intervals. That means the first participant starts at time 0, the second participant starts at time x, the third — at time 2⋅x, and so on. The duration of the contest is t minutes for each participant, so the firs...
Compilable
For this Question: Given an integer K and a queue of integers, your task is to reverse the order of the first K elements of the queue, leaving the other elements in the same relative order.User task: Since this will be a functional problem, you don't have to take input. You just have to complete the functions: <b>R...
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: Perform the loop operation to create a square pattern for the given number of rows. <b>Example</b> number of rows = 5 ***** * * * * * * *****The only line contains the integer "size" denoting the number of rows. <b>Constarints</b> 1 &le; size &le; 7Print the square pattern.Sample input: ...
Compilable
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr. All the elements of the array are distinct.First line of input contains a single integer N. Second line of input contains N integers denoting the array Arr. Constraints: 1 <= N <= 100000 1 <= Arr[i] <=...
Compilable
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr. All the elements of the array are distinct.First line of input contains a single integer N. Second line of input contains N integers denoting the array Arr. Constraints: 1 <= N <= 100000 1 <= Arr[i] <=...
Compilable
For this Question: Given an array Arr of length N. Print the lexographically minimum rotation of the array Arr. All the elements of the array are distinct.First line of input contains a single integer N. Second line of input contains N integers denoting the array Arr. Constraints: 1 <= N <= 100000 1 <= Arr[i] <=...
Compilable
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n Constraints:- 0 <= n <= 20Output is a single line containing factorial(n)Sample Input 5 Sample Output 120 Explanation:- 5!= 5 * 4 * 3 * 2 * 1 = 120 Sample Input 10 ...
Compilable
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n Constraints:- 0 <= n <= 20Output is a single line containing factorial(n)Sample Input 5 Sample Output 120 Explanation:- 5!= 5 * 4 * 3 * 2 * 1 = 120 Sample Input 10 ...
Compilable
For this Question: Find factorial of a given number where n! = n * n-1 * n-2 .....* 1First line consists of a single integer denoting n Constraints:- 0 <= n <= 20Output is a single line containing factorial(n)Sample Input 5 Sample Output 120 Explanation:- 5!= 5 * 4 * 3 * 2 * 1 = 120 Sample Input 10 ...
Compilable
For this Question: You are given an array A of size N. In one move, you can choose two indices i, j (1 <= i, j <= N) such that A<sub>i</sub>+A<sub>j</sub> is odd and swap A<sub>i</sub> and A<sub>j</sub>. Find the lexicographically smallest array you can obtain after any number of operations.The first line of the input ...
Compilable
For this Question: You are given an array A of size N. In one move, you can choose two indices i, j (1 <= i, j <= N) such that A<sub>i</sub>+A<sub>j</sub> is odd and swap A<sub>i</sub> and A<sub>j</sub>. Find the lexicographically smallest array you can obtain after any number of operations.The first line of the input ...
Compilable
For this Question: After saving the planet of Xander in 2014 from Ronan, the guardians of the galaxy decided to play a game on it. Between the vast furious oceans, they discover a row of buildings. The buildings are of different heights arranged at each index along a number line. Gamora starts at building 0 and a heigh...
Compilable
For this Question: After saving the planet of Xander in 2014 from Ronan, the guardians of the galaxy decided to play a game on it. Between the vast furious oceans, they discover a row of buildings. The buildings are of different heights arranged at each index along a number line. Gamora starts at building 0 and a heigh...
Compilable
For this Question: Given a N x M integer matrix A and Q queries of form X1 Y1 X2 Y2. Print the sum of A[i][j], for X1 <= i <= X2 and Y1 <= j <= Y2.The first line contains two integer N and M, denoting the size of the matrix. Next N line contains M integers denoting elements of the matrix. Next line contains a single ...
Compilable
For this Question: Given a N x M integer matrix A and Q queries of form X1 Y1 X2 Y2. Print the sum of A[i][j], for X1 <= i <= X2 and Y1 <= j <= Y2.The first line contains two integer N and M, denoting the size of the matrix. Next N line contains M integers denoting elements of the matrix. Next line contains a single ...
Compilable
For this Question: You are given the following pseudocode: code : res = a for i = 1 to k if i is odd res = res & b else res = res | b You are also given the values of a, b and k. Find the value of res.First line contains of single integer t denoting number of test cases. Each test cases cons...
Compilable
For this Question: You are given the following pseudocode: code : res = a for i = 1 to k if i is odd res = res & b else res = res | b You are also given the values of a, b and k. Find the value of res.First line contains of single integer t denoting number of test cases. Each test cases cons...
Compilable
For this Question: You are given the following pseudocode: code : res = a for i = 1 to k if i is odd res = res & b else res = res | b You are also given the values of a, b and k. Find the value of res.First line contains of single integer t denoting number of test cases. Each test cases cons...
Compilable
For this Question: You are given an array Arr of N integers. A subarray is good if the sum of elements of that subarray is greater than or equal to K. Print the length of good subarray of minimum length.First line of input contains N and K. Second line of input contains N integers representing the elements of the arra...
Compilable
For this Question: You are given an array Arr of N integers. A subarray is good if the sum of elements of that subarray is greater than or equal to K. Print the length of good subarray of minimum length.First line of input contains N and K. Second line of input contains N integers representing the elements of the arra...
Compilable
For this Question: You are given an array Arr of N integers. A subarray is good if the sum of elements of that subarray is greater than or equal to K. Print the length of good subarray of minimum length.First line of input contains N and K. Second line of input contains N integers representing the elements of the arra...
Compilable
For this Question: You are given two arrays - value and frequency both containing N elements. There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times. Finally you have to tel...
Compilable
For this Question: You are given two arrays - value and frequency both containing N elements. There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times. Finally you have to tel...
Compilable
For this Question: You are given two arrays - value and frequency both containing N elements. There is also a third array C which is currently empty. Then you perform N insertion operation in the array. For ith operation you insert value[i] to the end of the array frequency[i] number of times. Finally you have to tel...
Compilable
For this Question: Given a string S consisting of characters 'A' or 'B' only, you need to find the maximum length of substring consisting of character 'A' only.The first and the only line of input contains the string S. Constraints 1 <= |S| <= 100000 S consists of characters 'A' or 'B' only.Output a single integer...
Compilable
For this Question: Given a string S consisting of characters 'A' or 'B' only, you need to find the maximum length of substring consisting of character 'A' only.The first and the only line of input contains the string S. Constraints 1 <= |S| <= 100000 S consists of characters 'A' or 'B' only.Output a single integer...
Compilable
For this Question: Given a string S consisting of characters 'A' or 'B' only, you need to find the maximum length of substring consisting of character 'A' only.The first and the only line of input contains the string S. Constraints 1 <= |S| <= 100000 S consists of characters 'A' or 'B' only.Output a single integer...
Compilable
For this Question: Given a string A. The only operation allowed is to insert characters at the beginning of the string. Find how many minimum characters are needed to be inserted to make the string a palindrome string. Note: Strings are to be considered case sensitive.Input contains a single line string. Constrain...
Compilable
For this Question: Given a string A. The only operation allowed is to insert characters at the beginning of the string. Find how many minimum characters are needed to be inserted to make the string a palindrome string. Note: Strings are to be considered case sensitive.Input contains a single line string. Constrain...
Compilable
For this Question: Mahesh has won some money K from a lottery, he wants to distribute the money among his three sisters. His sisters already have some money with them. Let's say they have x, y, z amount of money. Now mahesh wants to distribute his money such that all the sisters have the same amount of total money left...
Compilable
For this Question: Mahesh has won some money K from a lottery, he wants to distribute the money among his three sisters. His sisters already have some money with them. Let's say they have x, y, z amount of money. Now mahesh wants to distribute his money such that all the sisters have the same amount of total money left...
Compilable
For this Question: Mahesh has won some money K from a lottery, he wants to distribute the money among his three sisters. His sisters already have some money with them. Let's say they have x, y, z amount of money. Now mahesh wants to distribute his money such that all the sisters have the same amount of total money left...
Compilable
For this Question: Mahesh has won some money K from a lottery, he wants to distribute the money among his three sisters. His sisters already have some money with them. Let's say they have x, y, z amount of money. Now mahesh wants to distribute his money such that all the sisters have the same amount of total money left...
Compilable
For this Question: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given. Shift each character of S by N in alphabetical order (see below), and print the resulting string. We assume that A follows Z. For example, shifting A by 2 results in C (A → B → C), and shifting Y...
Compilable
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s...
Compilable
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s...
Compilable
For this Question: Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.Each test case consists of two lines. The first line of each test case is N and S, where N is the size of the array and S is the sum. The second line of each test case contains N s...
Compilable
For this Question: Newton is standing before a typical staircase with N steps. Newton is standing on the 0-th step and wants to go to the N-th step. To reach the top he can either take a single step or he can take a double step (two steps) at the same time. However, M of the N steps are broken i. e. S<sub>1</sub>, S...
Compilable
For this Question: Given an integer array <b>arr</b> and a target value <b>K</b>. Print the minimum integer value <b>V</b> such that when we change all values greater than V in the array to V, <b>the absolute difference (|sum - K|) between the sum of the array elements and K is minimized.</b> Note: the answer is not...
Compilable
For this Question: Given an integer array <b>arr</b> and a target value <b>K</b>. Print the minimum integer value <b>V</b> such that when we change all values greater than V in the array to V, <b>the absolute difference (|sum - K|) between the sum of the array elements and K is minimized.</b> Note: the answer is not...
Compilable
For this Question: Given an integer array <b>arr</b> and a target value <b>K</b>. Print the minimum integer value <b>V</b> such that when we change all values greater than V in the array to V, <b>the absolute difference (|sum - K|) between the sum of the array elements and K is minimized.</b> Note: the answer is not...
Compilable
For this Question: There are three sticks with integer lengths l<sub>1</sub>, l<sub>2</sub> and l<sub>3</sub>. You are asked to break exactly one of them into two pieces in such a way that: - both pieces have positive (strictly greater than 0) integer length; - the total length of the pieces is equal to the original...
Compilable
For this Question: For a number N we have N! unique permutations. <b>A permutation is a sequence of integers from 1 to N of length N containing each number exactly once.</b> For a positive integer X, <b>X! = 1 * 2 * 3 *...* X-1 * X</b> Your task is to find the Kth smallest permutation when all possible permutations o...
Compilable
For this Question: For a number N we have N! unique permutations. <b>A permutation is a sequence of integers from 1 to N of length N containing each number exactly once.</b> For a positive integer X, <b>X! = 1 * 2 * 3 *...* X-1 * X</b> Your task is to find the Kth smallest permutation when all possible permutations o...
Compilable
For this Question: Given two strings a and b consisting of lowercase characters. The task is to check whether two given strings are an anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “act” and “tac” are...
Compilable
For this Question: Given two strings a and b consisting of lowercase characters. The task is to check whether two given strings are an anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “act” and “tac” are...
Compilable
For this Question: Given two strings a and b consisting of lowercase characters. The task is to check whether two given strings are an anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “act” and “tac” are...
Compilable
For this Question: Given two strings a and b consisting of lowercase characters. The task is to check whether two given strings are an anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “act” and “tac” are...
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: Newton has 3 groups of cards. Group 1 has X total of cards, Group 2 has Y cards, Group 3 has Z cards. All X cards have 1 written on them, all Y cards have 0 written on them, all Z cards have -1 written on them. Now Newton wants to pick C cards and add the values written on them. Help Newton pick C...
Compilable
For this Question: Newton has 3 groups of cards. Group 1 has X total of cards, Group 2 has Y cards, Group 3 has Z cards. All X cards have 1 written on them, all Y cards have 0 written on them, all Z cards have -1 written on them. Now Newton wants to pick C cards and add the values written on them. Help Newton pick C...
Compilable
For this Question: Newton has 3 groups of cards. Group 1 has X total of cards, Group 2 has Y cards, Group 3 has Z cards. All X cards have 1 written on them, all Y cards have 0 written on them, all Z cards have -1 written on them. Now Newton wants to pick C cards and add the values written on them. Help Newton pick C...
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: Yogi and Dharam are playing a game in which one has to solve the problem in order to get out of the room. Dharam goes first and Yogi gave him a problem. Since Dharam is having problem solving it, your task is to solve the problem for him. Problem:- Given a range from A to B your task is to count ...
Compilable
For this Question: Yogi and Dharam are playing a game in which one has to solve the problem in order to get out of the room. Dharam goes first and Yogi gave him a problem. Since Dharam is having problem solving it, your task is to solve the problem for him. Problem:- Given a range from A to B your task is to count ...
Compilable
For this Question: Alita has two a sequence of numbers x1, x2,…..xn. She has to go fight a battle with these sequence of numbers. But these numbers are not correct for the battle. She has to convert these numbers to another sequence of numbers y1, y2,…….yn. Alita is busy preparing for the battle so she needs your help....
Compilable
For this Question: Alita has two a sequence of numbers x1, x2,…..xn. She has to go fight a battle with these sequence of numbers. But these numbers are not correct for the battle. She has to convert these numbers to another sequence of numbers y1, y2,…….yn. Alita is busy preparing for the battle so she needs your help....
Compilable
For this Question: Alita has two a sequence of numbers x1, x2,…..xn. She has to go fight a battle with these sequence of numbers. But these numbers are not correct for the battle. She has to convert these numbers to another sequence of numbers y1, y2,…….yn. Alita is busy preparing for the battle so she needs your help....
Compilable
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies. Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.” Compute the maximum number of people who could be te...
Compilable
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies. Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.” Compute the maximum number of people who could be te...
Compilable
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies. Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.” Compute the maximum number of people who could be te...
Compilable
For this Question: Given N strings and Q queries, for each query you will be given a string, your task is to print all the anagrams of the string from the given N strings. If no anagrams exist then print -1. Note:- Given string may contain duplicated strings you should print it as many times as it occurs.First line ...
Compilable
For this Question: Given N strings and Q queries, for each query you will be given a string, your task is to print all the anagrams of the string from the given N strings. If no anagrams exist then print -1. Note:- Given string may contain duplicated strings you should print it as many times as it occurs.First line ...
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 an array of N integers, your task is to print all subarrays of the given array in the order given as:- First, print all the subarrays starting from the first element of the array in increasing order of their size. Then go for the second element and print all of its subarrays in increasing orde...
Compilable
For this Question: Given an array of N integers, your task is to print all subarrays of the given array in the order given as:- First, print all the subarrays starting from the first element of the array in increasing order of their size. Then go for the second element and print all of its subarrays in increasing orde...
Compilable
For this Question: Given a positive integer N, construct a string of length N such that no two adjacent characters are the same. Among all possible strings, find the lexicographically minimum string. Note: You can use only lowercase characters from 'a' to 'z'.The first and only line of input contains an integer N. ...
Compilable
For this Question: Given a positive integer N, construct a string of length N such that no two adjacent characters are the same. Among all possible strings, find the lexicographically minimum string. Note: You can use only lowercase characters from 'a' to 'z'.The first and only line of input contains an integer N. ...
Compilable
For this Question: Given a positive integer N, construct a string of length N such that no two adjacent characters are the same. Among all possible strings, find the lexicographically minimum string. Note: You can use only lowercase characters from 'a' to 'z'.The first and only line of input contains an integer N. ...
Compilable
For this Question: Given an array Arr of N elements. Find the minimum number of elements that you need to delete from this array such that all the elements in the array become distinct.First line of input contains a single integer N. Second line of input contains N space separated integers, denoting the array Arr. ...
Compilable
For this Question: Given an array Arr of N elements. Find the minimum number of elements that you need to delete from this array such that all the elements in the array become distinct.First line of input contains a single integer N. Second line of input contains N space separated integers, denoting the array Arr. ...
Compilable