Instruction
stringlengths
261
35k
Response
stringclasses
1 value
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 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 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 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: 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 two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Bob participated in N Quizzes. Each quiz consists of M questions. Given an N X M matrix results where results[i][j] = 1 if Bob answered j<sup>th</sup> question correctly in the i<sup>th</sup> Quiz. Each correct answer gives 10 marks and he has the option to select any quiz session for the marks e...
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: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Given two positive integers N and M. Your task is to print first <b>M Special GCD numbers</b> which are greater than N. <b>M Special GCD numbers</b> : First M numbers which are greater than N and whose GCD with N is equal to the smallest prime factor of N.User Task: Since this is a functional probl...
Compilable
For this Question: Olivia likes triangles. Hence, John decided to give her three integers and ask whether a triangle with edge length as given three integers is possible. Help Olivia in answering it.The input consists of a single line containing three space-separated integers A, B, and C. <b>Constraints </b> 1 <= ...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:- 1 2 3 5 1 5 9 1 2 8 Sample Output:- 1 2 3 5 9 8 <b>Explanation:-</b> Extra 1, 2, and 5 were removed since they were occurring mu...
Compilable
For this Question: Remove duplicates of an array and return an array of only unique elements.An array containing numbers.Space separated unique elements from the array.Sample Input:- 1 2 3 5 1 5 9 1 2 8 Sample Output:- 1 2 3 5 9 8 <b>Explanation:-</b> Extra 1, 2, and 5 were removed since they were occurring mu...
Compilable
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: Given an array Arr of N elements, your task is to find the sum of the difference of maximum and minimum element of all subarrays.The first line of input contains a single integer N, and the next line of input contains N space-separated integers depicting the values of the array. <b>Constraints:-</...
Compilable
For this Question: Given an array Arr of N elements, your task is to find the sum of the difference of maximum and minimum element of all subarrays.The first line of input contains a single integer N, and the next line of input contains N space-separated integers depicting the values of the array. <b>Constraints:-</...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: Santa has been trying to solve the following task. Would you please help him so that he can go back to distributing gifts? Given an integer N, print "AC" if N is 1. Otherwise, print "WA". Note: You are supposed to print "AC" and "WA" without the quotes.The input consists of a single line contai...
Compilable
For this Question: An array of numbers is given. It has all unique elements except one. Find the only duplicate element in that array having all other unique elements.The first line contains an integer N, the number of elements in the array. The second line contains N integers. Constraints: 1 <= N <= 10^5 1 <= El...
Compilable
For this Question: An array of numbers is given. It has all unique elements except one. Find the only duplicate element in that array having all other unique elements.The first line contains an integer N, the number of elements in the array. The second line contains N integers. Constraints: 1 <= N <= 10^5 1 <= El...
Compilable
For this Question: Given a Deque and Q queries. The task is to perform some operation on Deque according to the queries as described in input: Note:-if deque is empty than pop operation will do nothing, and -1 will be printed as a front and rear element of queue if it is empty.User task: Since this will be a functi...
Compilable
For this Question: Given a number N and a number P, your task is to calculate N<sup>P</sup>. Since the ans can be very long calculate your ans as N<sup>P</sup>%M where M = 10<sup>9</sup>+7Input contains only two integers N and P separated by spaces. Constraints:- 1 < = N, P <= 1000000000Print N<sup>P</sup>%M.Sampl...
Compilable
For this Question: Given a number N and a number P, your task is to calculate N<sup>P</sup>. Since the ans can be very long calculate your ans as N<sup>P</sup>%M where M = 10<sup>9</sup>+7Input contains only two integers N and P separated by spaces. Constraints:- 1 < = N, P <= 1000000000Print N<sup>P</sup>%M.Sampl...
Compilable
For this Question: Given a number N and a number P, your task is to calculate N<sup>P</sup>. Since the ans can be very long calculate your ans as N<sup>P</sup>%M where M = 10<sup>9</sup>+7Input contains only two integers N and P separated by spaces. Constraints:- 1 < = N, P <= 1000000000Print N<sup>P</sup>%M.Sampl...
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 linked list, the task is to move all 0’s to the front of the linked list. The order of all another element except 0 should be same after rearrangement. Note: Avoid use of any type of Java Collection frameworks. Note: For custom input/output, enter the list in reverse order, and the outp...
Compilable
For this Question: Given a number N, find the value of the below Equation for the given number. Equation: - N ∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2} X = 1<b>User task:</b> Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu...
Compilable
For this Question: Given a number N, find the value of the below Equation for the given number. Equation: - N ∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2} X = 1<b>User task:</b> Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu...
Compilable
For this Question: Given a number N, find the value of the below Equation for the given number. Equation: - N ∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2} X = 1<b>User task:</b> Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu...
Compilable
For this Question: Given a number N, find the value of the below Equation for the given number. Equation: - N ∑ {(X - 1)<sup>3</sup> + 3(X + 1)<sup>2</sup> + 2} X = 1<b>User task:</b> Since this is a functional problem, you don’t have to worry about the input, you just have to complete the function <b>equationSu...
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: 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: 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: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: You think that integers divisible by K are nice. Given L and R (L<=R), find the number of nice integers from L to R (both inclusive).First Line of input contains three integers L R K Constraints : 0 <= L <= R <= 1000000000000000000(10^18) 1 <= K <= 1000000000000000000(10^18)Output a single int...
Compilable
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input. ...
Compilable
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input. ...
Compilable
For this Question: Take input from standard input while you do not get 0 as an input. Print all the inputs separated by space. It is guaranteed that the number of integers are less than 100000.The input will contain a series of integers in one line each. Input should be taken while you have not get a 0 as an input. ...
Compilable
For this Question: You have r red and b blue beans. You'd like to distribute them among several (maybe, one) packets in such a way that each packet: 1. Has at least one red bean (or the number of red beans r<sub>i</sub> &le; 1); 2. Has at least one blue bean (or the number of blue beans b<sub>i</sub> &le; 1); 3. The...
Compilable
For this Question: You must be familiar with various types of operators. One of the most commonly used operators in any language are increment and decrement operators. Given two numbers X and Y. Your task is to print the value of X decremented by 1 and value of Y after incremented by 1.The first line of the input conta...
Compilable
For this Question: You must be familiar with various types of operators. One of the most commonly used operators in any language are increment and decrement operators. Given two numbers X and Y. Your task is to print the value of X decremented by 1 and value of Y after incremented by 1.The first line of the input conta...
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: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix. Constraints:- 1 <=...
Compilable
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix. Constraints:- 1 <=...
Compilable
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix. Constraints:- 1 <=...
Compilable
For this Question: Given a matrix of size M*N, your task is to find the column having the maximum sum and print the sum.The first line of input contains two space-separated integers M and N. The following M lines of input contain N space-separated integers each depicting the values of the matrix. Constraints:- 1 <=...
Compilable
For this Question: Given an array Arr with N distinct integers from 1 to N. If you are currently at index i then in a single jump you move to the index Arr[i]. You start at standing at index 1. Find the index you will be after K jumps.First line of input contains two integers N and K. Second line of input contains N i...
Compilable
For this Question: Given an array Arr with N distinct integers from 1 to N. If you are currently at index i then in a single jump you move to the index Arr[i]. You start at standing at index 1. Find the index you will be after K jumps.First line of input contains two integers N and K. Second line of input contains N i...
Compilable
For this Question: Given an array Arr with N distinct integers from 1 to N. If you are currently at index i then in a single jump you move to the index Arr[i]. You start at standing at index 1. Find the index you will be after K jumps.First line of input contains two integers N and K. Second line of input contains N i...
Compilable
For this Question: Separate chaining technique in hashing allows us to use a linked list at each hash slot to handle the problem of collisions. That is, every slot of the hash table is a linked list, so whenever a collision occurs, the element can be appened as a node to the linked list at the slot. In this question...
Compilable
For this Question: Separate chaining technique in hashing allows us to use a linked list at each hash slot to handle the problem of collisions. That is, every slot of the hash table is a linked list, so whenever a collision occurs, the element can be appened as a node to the linked list at the slot. In this question...
Compilable
For this Question: Separate chaining technique in hashing allows us to use a linked list at each hash slot to handle the problem of collisions. That is, every slot of the hash table is a linked list, so whenever a collision occurs, the element can be appened as a node to the linked list at the slot. In this question...
Compilable
For this Question: Negi is fascinated with the binary representation of the number. Tell him the number of set bits (ones) in the binary representation of an integer N.The first line of the input contains single integer N. Constraints 1 <= N <= 1000000000000The output should contain a single integer, the number of...
Compilable
For this Question: Negi is fascinated with the binary representation of the number. Tell him the number of set bits (ones) in the binary representation of an integer N.The first line of the input contains single integer N. Constraints 1 <= N <= 1000000000000The output should contain a single integer, the number of...
Compilable
For this Question: Negi is fascinated with the binary representation of the number. Tell him the number of set bits (ones) in the binary representation of an integer N.The first line of the input contains single integer N. Constraints 1 <= N <= 1000000000000The output should contain a single integer, the number of...
Compilable
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it. First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum...
Compilable
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it. First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum...
Compilable
For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it. First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum...
Compilable
For this Question: In this question, you will be adding a new method called <code>squareAndSort</code> to the <code>Array prototype</code>. This means that any array created in the future will have this method available to it. This method will be called on the <code>array with number and string data type elements</code...
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: Given an array of N elements and an integer D. Your task is to rotate the array D times in a circular manner from the right to left direction. Consider the examples for better understanding:- Try to do without creating another arrayUser task: Since this will be a functional problem, you don't have ...
Compilable
For this Question: This is a time of conflict in Westeros as Viserys Targaryen, the king of all seven kingdoms, rejected the hand of Lady Laena Velaryon. So, the Velaryon soldiers are not deemed trustworthy anymore. The Targaryen soldiers have to keep an eye on them. You are given a sequential order of N soldiers st...
Compilable
For this Question: This is a time of conflict in Westeros as Viserys Targaryen, the king of all seven kingdoms, rejected the hand of Lady Laena Velaryon. So, the Velaryon soldiers are not deemed trustworthy anymore. The Targaryen soldiers have to keep an eye on them. You are given a sequential order of N soldiers st...
Compilable
For this Question: This is a time of conflict in Westeros as Viserys Targaryen, the king of all seven kingdoms, rejected the hand of Lady Laena Velaryon. So, the Velaryon soldiers are not deemed trustworthy anymore. The Targaryen soldiers have to keep an eye on them. You are given a sequential order of N soldiers st...
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