Instruction
stringlengths
261
35k
Response
stringclasses
1 value
For this Question: Harry wants to rescue Fleur's sister Gabrielle in the underwater task. For that he needs to get ahead of all the people in the two magical queues. Our small Tono and Solo are busy casting spells alternatively to remove people from the two magical queues. But since they are highly competitive, both ...
Compilable
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not. <b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a...
Compilable
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not. <b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a...
Compilable
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not. <b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a...
Compilable
For this Question: Given a sorted array arr[] of N integers and a number K is given. The task is to check if the element K is present in the array or not. <b>Note:</b> Use binary search to solve the problemThe first line of input contains a number of test cases T. For each test case, the first line of input contains a...
Compilable
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements. For ...
Compilable
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements. For ...
Compilable
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements. For ...
Compilable
For this Question: Given an array A[], of size N containing positive integers. You need to print the elements of an array in increasing order.The first line of the input denotes the number of test cases 'T'. The first line of the test case is the size of the array and the second line consists of array elements. For ...
Compilable
For this Question: Given 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: Bob has an array of N numbers. He wants to calculate the product of the array but does not want integers greater than 10<sup>18</sup>. So, if the result exceeds 10<sup>18</sup>, print -1 instead.<b>Constraints:</b> 2 &le; N &le; 10<sup>5</sup> 0 &le; A<sub>i</sub> &le; 10<sup>18</sup> All values i...
Compilable
For this Question: Bob has an array of N numbers. He wants to calculate the product of the array but does not want integers greater than 10<sup>18</sup>. So, if the result exceeds 10<sup>18</sup>, print -1 instead.<b>Constraints:</b> 2 &le; N &le; 10<sup>5</sup> 0 &le; A<sub>i</sub> &le; 10<sup>18</sup> All values i...
Compilable
For this Question: Bob has an array of N numbers. He wants to calculate the product of the array but does not want integers greater than 10<sup>18</sup>. So, if the result exceeds 10<sup>18</sup>, print -1 instead.<b>Constraints:</b> 2 &le; N &le; 10<sup>5</sup> 0 &le; A<sub>i</sub> &le; 10<sup>18</sup> All values i...
Compilable
For this Question: Find out all the names in the given sentence (Note names must be greater than 2 characters)Sentence or paragraphList of namesInput: Hi I am Ram Output: ['Ram'], I have written this Solution Code: import re st=input() pattern="[A-Z][a-z]{2,100}" l=re.findall(pattern,st) print(l) , In this ...
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: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her. In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N. Here, d(M) refers to the sum of a...
Compilable
For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her. In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N. Here, d(M) refers to the sum of a...
Compilable
For this Question: Alice has Q queries for you. If you can solve all her queries, she will invite you to participate in a fireworks display with her. In each query, she gives you a positive integer N, and you have to find the number of positive integers M such that M × d(M) = N. Here, d(M) refers to the sum of a...
Compilable
For this Question: Ram is given an array A of N integers. He was asked to perform the following operation, The operation goes like this, Ram can choose at most X numbers of distinct elements from the array. Print the maximum sum he could achieve.The first line of the input contains an integer T denoting number of test ...
Compilable
For this Question: Ram is given an array A of N integers. He was asked to perform the following operation, The operation goes like this, Ram can choose at most X numbers of distinct elements from the array. Print the maximum sum he could achieve.The first line of the input contains an integer T denoting number of test ...
Compilable
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1. For a given number N, find the closest silly number.<b>User Task:</b> Since this will be a functional problem, you don't have to take input. You just have to complete the funct...
Compilable
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1. For a given number N, find the closest silly number.<b>User Task:</b> Since this will be a functional problem, you don't have to take input. You just have to complete the funct...
Compilable
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1. For a given number N, find the closest silly number.<b>User Task:</b> Since this will be a functional problem, you don't have to take input. You just have to complete the funct...
Compilable
For this Question: A number is called Silly if it can be represented as the sum of the square of consecutive natural numbers starting from 1. For a given number N, find the closest silly number.<b>User Task:</b> Since this will be a functional problem, you don't have to take input. You just have to complete the funct...
Compilable
For this Question: Given the first 2 terms A and B of an Arithmetic Series, tell the Nth term of the series.<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>NthAP()</b> that takes the integer A, B, and N as a parameter. <b>Constraints...
Compilable
For this Question: An array A of size N is called magical if: 1. Each element of the array is a positive integer not exceeding M, that is, 1 ≤ A<sub>i</sub> ≤ M for each i. 2. For each i such that 1 ≤ i ≤ N, define f(i) = A<sub>1</sub> | A<sub>2</sub> | ... A<sub>i</sub>, where x | y denotes the bitwise OR of x and...
Compilable
For this Question: Chinmay went to meet Bunty with 2x2 sweet because Bunty is a sweet child, and he saw Bunty playing with a right-angled isosceles triangle with base B. Chinmay came up with an intriguing notion and challenged Bunty to solve it; if he succeeds, he will be rewarded. Since Chinmay only purchased 'x' amou...
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: There is a room filled with ‘V’ kg of vibranium and Ultron wants his robot army to get the vibranium from that room. N robots are sent with the value of vibranium each of them has to bring. For each i the ith robot wants to bring ‘Ai’ amount of vibranium. Robots come in and try to take vibranium one ...
Compilable
For this Question: There is a room filled with ‘V’ kg of vibranium and Ultron wants his robot army to get the vibranium from that room. N robots are sent with the value of vibranium each of them has to bring. For each i the ith robot wants to bring ‘Ai’ amount of vibranium. Robots come in and try to take vibranium one ...
Compilable
For this Question: There is a room filled with ‘V’ kg of vibranium and Ultron wants his robot army to get the vibranium from that room. N robots are sent with the value of vibranium each of them has to bring. For each i the ith robot wants to bring ‘Ai’ amount of vibranium. Robots come in and try to take vibranium one ...
Compilable
For this Question: We define a weird series as follows: 7, 77, 777, 7777, 77777, 777777,. . Given a positive integer N find where is first occurrence of a number divisible by N in the given series. If the series contains no multiple of N, print -1 instead.Input contains a single integer N. Constraints: 1 <= N <=...
Compilable
For this Question: We define a weird series as follows: 7, 77, 777, 7777, 77777, 777777,. . Given a positive integer N find where is first occurrence of a number divisible by N in the given series. If the series contains no multiple of N, print -1 instead.Input contains a single integer N. Constraints: 1 <= N <=...
Compilable
For this Question: We define a weird series as follows: 7, 77, 777, 7777, 77777, 777777,. . Given a positive integer N find where is first occurrence of a number divisible by N in the given series. If the series contains no multiple of N, print -1 instead.Input contains a single integer N. Constraints: 1 <= N <=...
Compilable
For this Question: Given a binary tree containing with N nodes and an integer X. Your task is to complete the function countSubtreesWithSumX() that returns the count of the number of subtress having total node’s data sum equal to a value X. Example: A tree given below<b>User Task:</b> Since this will be a functional...
Compilable
For this Question: 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: Write a class with the name SumCalculator. The class needs two fields (public variables) with names num1 and num2 both of type int. Write the following methods (instance methods): <b>*Method named sum without any parameters, it needs to return the value of num1 + num2.</b> <b>*Method named sum2 ...
Compilable
For this Question: Write a class with the name SumCalculator. The class needs two fields (public variables) with names num1 and num2 both of type int. Write the following methods (instance methods): <b>*Method named sum without any parameters, it needs to return the value of num1 + num2.</b> <b>*Method named sum2 ...
Compilable
For this Question: Given an integer N, find the number of integers from 1 to N, that are odd as well as have odd number of digits, eg: 333 will be counted while 33 or 332 will not be counted.The first line and the only line of the input contains an integer N. Constraints 1 <= N <= 100000Output a single integer, the...
Compilable
For this Question: Given an integer N, find the number of integers from 1 to N, that are odd as well as have odd number of digits, eg: 333 will be counted while 33 or 332 will not be counted.The first line and the only line of the input contains an integer N. Constraints 1 <= N <= 100000Output a single integer, the...
Compilable
For this Question: Given an integer N, find the number of integers from 1 to N, that are odd as well as have odd number of digits, eg: 333 will be counted while 33 or 332 will not be counted.The first line and the only line of the input contains an integer N. Constraints 1 <= N <= 100000Output a single integer, the...
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: Everyone has heard of palindromes, right! A palindrome is a string that remains the same if reversed. Let's define a new term, Dalindrome. A Dalindrome is a string whose atleast one of the substrings is a palindrome. Given a string, find whether it's a Dalindrome.The only line of input contains a...
Compilable
For this Question: Everyone has heard of palindromes, right! A palindrome is a string that remains the same if reversed. Let's define a new term, Dalindrome. A Dalindrome is a string whose atleast one of the substrings is a palindrome. Given a string, find whether it's a Dalindrome.The only line of input contains a...
Compilable
For this Question: Everyone has heard of palindromes, right! A palindrome is a string that remains the same if reversed. Let's define a new term, Dalindrome. A Dalindrome is a string whose atleast one of the substrings is a palindrome. Given a string, find whether it's a Dalindrome.The only line of input contains a...
Compilable
For this Question: Given an array, A of N integers. Find the product of maximum values for every subarray of size K. Print the answer modulo 10<sup>9</sup>+7. A subarray is any contiguous sequence of elements in an array.The first line contains two integers N and K, denoting the size of the array and the size of the s...
Compilable
For this Question: Given an array, A of N integers. Find the product of maximum values for every subarray of size K. Print the answer modulo 10<sup>9</sup>+7. A subarray is any contiguous sequence of elements in an array.The first line contains two integers N and K, denoting the size of the array and the size of the s...
Compilable
For this Question: Given an array, A of N integers. Find the product of maximum values for every subarray of size K. Print the answer modulo 10<sup>9</sup>+7. A subarray is any contiguous sequence of elements in an array.The first line contains two integers N and K, denoting the size of the array and the size of the s...
Compilable
For this Question: Given an array of N integers containing only 0 or 1. You can do the following operations on the array: <ul><li>swap elements at two indices</li><li>choose one index and change its value from 0 to 1 or vice-versa.</li></ul> You have to do the minimum number of the above operations such that the fina...
Compilable
For this Question: Given an array of N integers containing only 0 or 1. You can do the following operations on the array: <ul><li>swap elements at two indices</li><li>choose one index and change its value from 0 to 1 or vice-versa.</li></ul> You have to do the minimum number of the above operations such that the fina...
Compilable
For this Question: Given an array of N integers containing only 0 or 1. You can do the following operations on the array: <ul><li>swap elements at two indices</li><li>choose one index and change its value from 0 to 1 or vice-versa.</li></ul> You have to do the minimum number of the above operations such that the fina...
Compilable
For this Question: You are given an array and Q queries. Your task is to perform these operations:- enqueue: this operation will add an element to your current queue. dequeue: this operation will delete the element from the starting of the queue displayfront: this operation will print the element presented at ...
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: Given a sorted doubly linked list containing n nodes. Your task is to remove duplicate nodes from the given list. Example 1: Input 1<->2<->2-<->3<->3<->4 Output: 1<->2<->3<->4 Example 2: Input 1<->1<->1<->1 Output 1<b>User Task:</b> Since this will be a functional problem, you don'...
Compilable
For this Question: Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well.First line consists of a single integer denoting n. Constraint:- 1<=size of n<=100Output is a single line containing reversed number n.Sample Input 123445 Sampl...
Compilable
For this Question: Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well.First line consists of a single integer denoting n. Constraint:- 1<=size of n<=100Output is a single line containing reversed number n.Sample Input 123445 Sampl...
Compilable
For this Question: Given a number, you task is to reverse its digits. If the reversed number contains 0s in the beginning, you must remove them as well.First line consists of a single integer denoting n. Constraint:- 1<=size of n<=100Output is a single line containing reversed number n.Sample Input 123445 Sampl...
Compilable
For this Question: Is it possible to sort a given string s with at most a single deletion operation allowed, i.e., removing any one character from the string?The first line contains string s. <b>Constraints</b> n = |s| 1 &le; n &le; 100Print "YES" without quotes, if it is possible to sort the string, otherwise pri...
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: Padding is a process of adding layers of zeros to the input image. If we want to have p layers of padding then we have to add p layers of zeroes on borders. Given two integers N and p. How many zeroes are needed to be added to N X N image to give p layers of zero padding?First line contains N and ...
Compilable
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains one line of input containing the string S. ...
Compilable
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains one line of input containing the string S. ...
Compilable
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains one line of input containing the string S. ...
Compilable
For this Question: You are given a string S (containing only lowercase characters). You need to print the repeated character whose first appearance is leftmost.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains one line of input containing the string S. ...
Compilable
For this Question: Given a string, your task is to calculate the number of different characters in that string.The first line of the input contains length of string. Second line contains String. Constraints 1 <= string length <= 100 String contains only lowercase english lettersOutput a single integer which is the...
Compilable
For this Question: Given a string, your task is to calculate the number of different characters in that string.The first line of the input contains length of string. Second line contains String. Constraints 1 <= string length <= 100 String contains only lowercase english lettersOutput a single integer which is the...
Compilable
For this Question: Given a string, your task is to calculate the number of different characters in that string.The first line of the input contains length of string. Second line contains String. Constraints 1 <= string length <= 100 String contains only lowercase english lettersOutput a single integer which is the...
Compilable
For this Question: If the total income in Wonderland is strictly more than 100 dollars, a tax of 10 dollars is deducted. Alice's total income is X dollars. She was wondering how much money will she get. Help Alice to find out.The first line of input will contain a single integer T, denoting the number of test cases. Th...
Compilable
For this Question: If the total income in Wonderland is strictly more than 100 dollars, a tax of 10 dollars is deducted. Alice's total income is X dollars. She was wondering how much money will she get. Help Alice to find out.The first line of input will contain a single integer T, denoting the number of test cases. Th...
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: Write a function called lucky_sevens which takes an array of integers and returns true if any three consecutive elements sum to 7An array containing numbers.Print true if such triplet exists summing to 7 else print falseSample input:- [2, 1, 5, 1, 0] [1, 6] Sample output:- true false Explan...
Compilable
For this Question: Anya owns N triplets of integers (A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub>), for each i from 1 to N. She asks you to find a sequence of integers which satisfies the following conditions: 1. The sequence contains at least C<sub>i</sub> distinct integers from the closed interval [A<sub>i</sub>, B...
Compilable
For this Question: Anya owns N triplets of integers (A<sub>i</sub>, B<sub>i</sub>, C<sub>i</sub>), for each i from 1 to N. She asks you to find a sequence of integers which satisfies the following conditions: 1. The sequence contains at least C<sub>i</sub> distinct integers from the closed interval [A<sub>i</sub>, B...
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: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed. Given initial pos...
Compilable
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed. Given initial pos...
Compilable
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed. Given initial pos...
Compilable
For this Question: Naruto and Sasuke are on a S- Rank mission. Now They got bored and thought of competing in a race against each other in a horizontal plane. They decides a common spot C at which both of them will try to reach. Whoever reaches first wins the race, both of them run at the same speed. Given initial pos...
Compilable
For this Question: To enter Todo's amusement park, there are M counters. Total N people want to enter the amusement park, each of whom will line up in front of one of the counters. Any counter worker gets angry if the number of people lining up in front of him is at least 2 more than the number of people lining up in f...
Compilable
For this Question: To enter Todo's amusement park, there are M counters. Total N people want to enter the amusement park, each of whom will line up in front of one of the counters. Any counter worker gets angry if the number of people lining up in front of him is at least 2 more than the number of people lining up in f...
Compilable
For this Question: To enter Todo's amusement park, there are M counters. Total N people want to enter the amusement park, each of whom will line up in front of one of the counters. Any counter worker gets angry if the number of people lining up in front of him is at least 2 more than the number of people lining up in f...
Compilable
For this Question: Given three integers your task is to calculate the maximum integer among the given integers.<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>maxInteger()</b> that takes three integers a, b and c as a parameter. <b>C...
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