Instruction
stringlengths
261
35k
Response
stringclasses
1 value
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: You are given head which is a reference node to a singly- linked list. Complete the function delete_end which delete all nodes after M Nodes of a Linked List.User task: Since this will be a functional problem, you don't have to take input. You just have to complete the functions delete_end that take...
Compilable
For this Question: For an integer N, your task is to calculate sum of first N natural numbers.<b>User Task:</b> Since this will be a functional problem, you don't have to worry about input. You just have to complete the function <b>sum()</b> which takes the integer N as a parameter. Constraints: 1 <= N < = 1000000...
Compilable
For this Question: Given a sentence, your task is to print the sentence with its words present in a sorted manner. For eg:- The sentence:- "i am a rockstar developer" will be printed as "a am developer i rockstar"The Input contains only a sentence. Constraints:- Total characters present in the sentence will be les...
Compilable
For this Question: The students of Newton School threw a grand party to celebrate their hard work and achievements. They danced and sang the night away, enjoying delicious food and creating memories that would last a lifetime. There are N guests in the party and N-1 relationships are given. The guests are numbered 1,...
Compilable
For this Question: You have N light bulbs, however they are currently jumbled up in wires. When you start unravelling the bulbs, you observe that the situation can be described by a directed acyclic graph connecting the bulbs to each other. Formally, you are given a directed graph consisting of N nodes (numbered 1 t...
Compilable
For this Question: You have N light bulbs, however they are currently jumbled up in wires. When you start unravelling the bulbs, you observe that the situation can be described by a directed acyclic graph connecting the bulbs to each other. Formally, you are given a directed graph consisting of N nodes (numbered 1 t...
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: 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: The college mess offers circular and square parathas at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular paratha. The number of parathas in the mess is equal to the number of students. The sandwiches are placed ...
Compilable
For this Question: Given a sequence of three integers, check if the product of all these numbers is divisible by 20.The first line contains 3 space- separated integers a, b, and c. <b>Constraints</b> 1 &le; a, b, c &le; 100Print true, if the product is divisible by 20, otherwise, print false.Sample Input 1 : 8 1 3...
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 a Binary Search Tree and 2 node value <b>n1</b> and <b>n2</b>, your task is to find the <b>lowest common ancestor(LCA)</b> of the two nodes given. It may happen that values n1 and n2 may or may be not present. <b>Note:</b> Duplicates are not inserted in the BST.<b>User Task:</b> This is a ...
Compilable
For this Question: Solo likes to solve simple problems, but this time she is stuck with an easy problem she created herself. Since she cannot visit her friends currently (neither should you), can you code this problem for her? The problem is short and sweet. Given an integer n, can you find the smallest n-digit numb...
Compilable
For this Question: Solo likes to solve simple problems, but this time she is stuck with an easy problem she created herself. Since she cannot visit her friends currently (neither should you), can you code this problem for her? The problem is short and sweet. Given an integer n, can you find the smallest n-digit numb...
Compilable
For this Question: Solo likes to solve simple problems, but this time she is stuck with an easy problem she created herself. Since she cannot visit her friends currently (neither should you), can you code this problem for her? The problem is short and sweet. Given an integer n, can you find the smallest n-digit numb...
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: Sara want to buy a toy and for this purpose she goes to a toy shop, there is a special offer going in the toy shop that is if you buy one toy you can get extra k toys for free now Sara wonders what is the minimum amount of money she need to spend so that she can get all the toys. You are given som...
Compilable
For this Question: Sara want to buy a toy and for this purpose she goes to a toy shop, there is a special offer going in the toy shop that is if you buy one toy you can get extra k toys for free now Sara wonders what is the minimum amount of money she need to spend so that she can get all the toys. You are given som...
Compilable
For this Question: Sara want to buy a toy and for this purpose she goes to a toy shop, there is a special offer going in the toy shop that is if you buy one toy you can get extra k toys for free now Sara wonders what is the minimum amount of money she need to spend so that she can get all the toys. You are given som...
Compilable
For this Question: While Solo was playing with an array A of N integers, her little sister Tono asked her the following question: For each integer i from 1 to N, find the smallest non- negative integer that is missing in subarray A[0]...A[i-1]. As Solo wants to play, please help her solve the following problem.The ...
Compilable
For this Question: While Solo was playing with an array A of N integers, her little sister Tono asked her the following question: For each integer i from 1 to N, find the smallest non- negative integer that is missing in subarray A[0]...A[i-1]. As Solo wants to play, please help her solve the following problem.The ...
Compilable
For this Question: While Solo was playing with an array A of N integers, her little sister Tono asked her the following question: For each integer i from 1 to N, find the smallest non- negative integer that is missing in subarray A[0]...A[i-1]. As Solo wants to play, please help her solve the following problem.The ...
Compilable
For this Question: You are given a grid having N*M elements. Find the index of the row (1-base indexing) which has the maximum sum of elements. Note: if more than two rows have the same sum of elements, then return the smallest index.The first line of the input contains two integers N and M. The next N lines each con...
Compilable
For this Question: You are given a grid having N*M elements. Find the index of the row (1-base indexing) which has the maximum sum of elements. Note: if more than two rows have the same sum of elements, then return the smallest index.The first line of the input contains two integers N and M. The next N lines each con...
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: You will be given an array of several arrays that each contain integers and your goal is to write a function that will sum up all the numbers in all the arrays. For example, if the input is [[3, 2], [1], [4, 12]] then your program should output 22 because 3 + 2 + 1 + 4 + 12 = 22An array containing ...
Compilable
For this Question: Given a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task: Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b...
Compilable
For this Question: Given a number N, you need to check whether the given number is <b>Palindrome</b> or not. A number is said to be Palindrome when it reads the same from backward as forward.User task: Since this is a functional problem you don't have to worry about the input. You just have to complete the function <b...
Compilable
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80. Your task is to find out Alice's power after N seconds.The input consists of a single li...
Compilable
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80. Your task is to find out Alice's power after N seconds.The input consists of a single li...
Compilable
For this Question: Alice's power is currently known to be an integer X. It is also known that her power doubles every second. For example, if Alice's power was currently 20, then after 2 seconds her power would have grown to 80. Your task is to find out Alice's power after N seconds.The input consists of a single li...
Compilable
For this Question: You are given a chessboard of size N x N, where the top left square is black. Each square contains a value. Find the sum of the values of all black squares and all white squares. Remember that in a chessboard black and white squares are alternate.The first line of input will be the N size of the m...
Compilable
For this Question: You are given a chessboard of size N x N, where the top left square is black. Each square contains a value. Find the sum of the values of all black squares and all white squares. Remember that in a chessboard black and white squares are alternate.The first line of input will be the N size of the m...
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 a binary tree with n nodes (numbered from 1 to n) having weight wi and left and right children (li, ri), find whether the given tree is BST or not.The first line of the input contains an integer n, the number of nodes in the tree. The second line of input contains n integers, the values of the...
Compilable
For this Question: Given a binary tree with n nodes (numbered from 1 to n) having weight wi and left and right children (li, ri), find whether the given tree is BST or not.The first line of the input contains an integer n, the number of nodes in the tree. The second line of input contains n integers, the values of the...
Compilable
For this Question: Given a binary tree with n nodes (numbered from 1 to n) having weight wi and left and right children (li, ri), find whether the given tree is BST or not.The first line of the input contains an integer n, the number of nodes in the tree. The second line of input contains n integers, the values of the...
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 have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: Given an integer array A of size N. Another array B is defined as: B[i] = A[j] such that j > i and A[j] < A[i]. If there does not exist any index j satisfying the above conditions then B[i] = -1. Find the array B.The first line contains an integer N. The next line contains N space-separated integ...
Compilable
For this Question: Given an integer array A of size N. Another array B is defined as: B[i] = A[j] such that j > i and A[j] < A[i]. If there does not exist any index j satisfying the above conditions then B[i] = -1. Find the array B.The first line contains an integer N. The next line contains N space-separated integ...
Compilable
For this Question: Given a circular linked list consisting of N nodes and an integer K, your task is to add the integer K at the end of the list. <b>Note: Sample Input and Output just show how a linked list will look depending on the questions. Do not copy-paste as it is in custom input</b><b>User Task:</b> Sinc...
Compilable
For this Question: The head of the doubly linked list will be given to you, and you must sort it using merge sort.You will be given the head of doubly Linked List and its length. Constraints: 0<= n <=10000Return the HEAD of the sorted linked list.Sample Input: 5 3 2 1 3 2 Output: 1 2 2 3 3, I have written this...
Compilable
For this Question: The head of the doubly linked list will be given to you, and you must sort it using merge sort.You will be given the head of doubly Linked List and its length. Constraints: 0<= n <=10000Return the HEAD of the sorted linked list.Sample Input: 5 3 2 1 3 2 Output: 1 2 2 3 3, I have written this...
Compilable
For this Question: You have to complete <code>printName</code> function <ol> <li>Takes 2 arguments which are EventEmitter object , event name </li> <li>Using the <code>EventEmitter</code> object you need to register an eventListener for <code>personEvent</code> event which takes a callback function. </li> <l...
Compilable
For this Question: Given a function f(x) = ax<sup>2 </sup> + bx + c and an integer K. Find the minimum non - negative integer value of <b>t</b> such that f(t) >= K.First line contains four positive integers a, b, c, K. Constraints 1 <= a, b, c <=100 0 <= K <= 10^16Print the value of <b>t</b>.Sample Input 1: 1 1 1...
Compilable
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter. Constraints:- 1<=N<=10^9Return t...
Compilable
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter. Constraints:- 1<=N<=10^9Return t...
Compilable
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter. Constraints:- 1<=N<=10^9Return t...
Compilable
For this Question: Given an integer N, your task is to return the sum of all of its divisors.<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>SumOfDivisors()</b> that takes the integer N as parameter. Constraints:- 1<=N<=10^9Return t...
Compilable
For this Question: Given an n x n matrix and a number x, find whether given element present in matrix or not, every row and column is sorted in increasing order. The designed algorithm should have linear time complexity.first line contain two element n and x. next n line contain n space separated integer i. e. element...
Compilable
For this Question: Given an n x n matrix and a number x, find whether given element present in matrix or not, every row and column is sorted in increasing order. The designed algorithm should have linear time complexity.first line contain two element n and x. next n line contain n space separated integer i. e. element...
Compilable
For this Question: Rick wants to give Morty a chapo (a super awesome treat :P). The only condition for Morty to get a chapo is that he should be able to reach Rick's place. Both Rick and Morty live on the number line at integer points A and B respectively. There are N types of moves M<sub>1</sub>, M<sub>2</sub>,. ,...
Compilable
For this Question: Rick wants to give Morty a chapo (a super awesome treat :P). The only condition for Morty to get a chapo is that he should be able to reach Rick's place. Both Rick and Morty live on the number line at integer points A and B respectively. There are N types of moves M<sub>1</sub>, M<sub>2</sub>,. ,...
Compilable
For this Question: Rick wants to give Morty a chapo (a super awesome treat :P). The only condition for Morty to get a chapo is that he should be able to reach Rick's place. Both Rick and Morty live on the number line at integer points A and B respectively. There are N types of moves M<sub>1</sub>, M<sub>2</sub>,. ,...
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: You are given 3 non-negative integers A, B and C. In one operation, you can pick any two of the given integers and subtract one from both of them. If it is possible to make all the 3 integers zero after some number of operations (possibly none), print "Yes". Otherwise, print "No".The first line co...
Compilable
For this Question: You are given 3 non-negative integers A, B and C. In one operation, you can pick any two of the given integers and subtract one from both of them. If it is possible to make all the 3 integers zero after some number of operations (possibly none), print "Yes". Otherwise, print "No".The first line co...
Compilable
For this Question: You are given 3 non-negative integers A, B and C. In one operation, you can pick any two of the given integers and subtract one from both of them. If it is possible to make all the 3 integers zero after some number of operations (possibly none), print "Yes". Otherwise, print "No".The first line co...
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
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: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: You have a house, which you model as an axis-aligned rectangle with corners at (x1, y1) and (x2, y2). You also have a goat, which you want to tie to a fence post located at (x, y), with a rope of length l. The goat can reach anywhere within a distance l from the fence post. Find the largest value ...
Compilable
For this Question: Given an integer N as an input, print a pattern as shown in sample.Input contains a single integer N Constraints:- 1<=N<=15Print the patter for N.Sample Input: 3 Sample Output: 3 3 3 3 3 3 2 2 2 3 3 2 1 2 3 3 2 2 2 3 3 3 3 3 3, I have written this Solution Code: #include <bits/stdc++.h>...
Compilable
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N. ...
Compilable
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N. ...
Compilable
For this Question: Given a string of length N. You have to select two non- overlapping (no common index) non- empty substrings of odd lengths from that string such that both those substrings are palindrome. You want the product of lengths of those substring to be maximum.Input contains of a single String of length N. ...
Compilable
For this Question: You will be given an array of N numbers. Your task is to first reverse the array (the first number becomes last, 2nd number becomes 2nd from the last, and so on) and then print the sum of the numbers at even indices and print the product of the numbers at odd indices. <b>Note :</b> 1 based indexin...
Compilable
For this Question: You will be given an array of N numbers. Your task is to first reverse the array (the first number becomes last, 2nd number becomes 2nd from the last, and so on) and then print the sum of the numbers at even indices and print the product of the numbers at odd indices. <b>Note :</b> 1 based indexin...
Compilable
For this Question: You will be given an array of N numbers. Your task is to first reverse the array (the first number becomes last, 2nd number becomes 2nd from the last, and so on) and then print the sum of the numbers at even indices and print the product of the numbers at odd indices. <b>Note :</b> 1 based indexin...
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 an array, Arr of N integers. Find the number of non- empty subarrays such that xor of all the elements of that subarray is divisible by 8.First line of input contains a single integer N. Second line of input contains N integers denoting the elements of Arr. Constraints: 1 <= N <= 100000 1...
Compilable
For this Question: Given an array, Arr of N integers. Find the number of non- empty subarrays such that xor of all the elements of that subarray is divisible by 8.First line of input contains a single integer N. Second line of input contains N integers denoting the elements of Arr. Constraints: 1 <= N <= 100000 1...
Compilable
For this Question: Given two strings S1 and S2 you have to make the two strings equal. To make them equal you can change any character of S1 or S2 to any other lowercase letter. You can perform this operation at most X number of times. Find the number of ways to make S1 and S2 equal. Two ways are considered diffe...
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: There are two number a and b are given as input. Print common digits with common index in these numbers seperated by space.There are two number a and b are given as input. <b>Constraints</b> 1 <= a, b <= 10<sup>6</sup>Print common digits with common index in these numbers seperated by space.Sampl...
Compilable