Instruction stringlengths 261 35k | Response stringclasses 1
value |
|---|---|
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 array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | Compilable |
For this Question: Given an array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | Compilable |
For this Question: Given an array <b>A[]</b>, of length <b>N</b> containing zero , positive and negative integers.
You need to find the length of the largest subarray whose sum of elements is <b>0</b>.The first line contains N denoting the size of the array A. Then in the next line contains N space-separated values o... | Compilable |
For this Question: Given a number 'N'. The task is to find the Nth number whose each digit is a prime number(<10) i.e 2, 3, 5, 7. In other words you have to find nth number of this sequence : 2, 3, 5, 7, 22, 23 ,.. and so on.The first line contains a single integer T i.e. the number of test cases. The first and only li... | Compilable |
For this Question: Given a number 'N'. The task is to find the Nth number whose each digit is a prime number(<10) i.e 2, 3, 5, 7. In other words you have to find nth number of this sequence : 2, 3, 5, 7, 22, 23 ,.. and so on.The first line contains a single integer T i.e. the number of test cases. The first and only li... | Compilable |
For this Question: Given a number 'N'. The task is to find the Nth number whose each digit is a prime number(<10) i.e 2, 3, 5, 7. In other words you have to find nth number of this sequence : 2, 3, 5, 7, 22, 23 ,.. and so on.The first line contains a single integer T i.e. the number of test cases. The first and only li... | 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 integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | Compilable |
For this Question: Given an integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | Compilable |
For this Question: Given an integer array <strong>arr[]</strong> of size <strong>N</strong> and an element <strong>X</strong>. The task is to find and print the indices of the given element if it is present in array if not then print “<strong>Not found</strong>” without quotes.
<strong>Note</strong>: The elements m... | 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: Ram is learning chess for the first time, So his father first starts his training with the piece <b>Knight</b>. His father gave Ram 2 random points ((x, y) and (a, b)), ie position of any piece on a 8x8 chess board and then asks Ram can he put the knight on the board so that both of the pieces get at... | Compilable |
For this Question: Ram is learning chess for the first time, So his father first starts his training with the piece <b>Knight</b>. His father gave Ram 2 random points ((x, y) and (a, b)), ie position of any piece on a 8x8 chess board and then asks Ram can he put the knight on the board so that both of the pieces get at... | Compilable |
For this Question: Ram is learning chess for the first time, So his father first starts his training with the piece <b>Knight</b>. His father gave Ram 2 random points ((x, y) and (a, b)), ie position of any piece on a 8x8 chess board and then asks Ram can he put the knight on the board so that both of the pieces get at... | Compilable |
For this Question: You have N cakes and there are K people. You want to distribute cake among these K people such that following conditions are satisfied:
> You cannot give N cakes to a single person.
> All the people who get atleast one cake should all get same number of cakes.
> You must distribute all N cakes.
F... | Compilable |
For this Question: You have N cakes and there are K people. You want to distribute cake among these K people such that following conditions are satisfied:
> You cannot give N cakes to a single person.
> All the people who get atleast one cake should all get same number of cakes.
> You must distribute all N cakes.
F... | Compilable |
For this Question: You have N cakes and there are K people. You want to distribute cake among these K people such that following conditions are satisfied:
> You cannot give N cakes to a single person.
> All the people who get atleast one cake should all get same number of cakes.
> You must distribute all N cakes.
F... | Compilable |
For this Question: Given a Binary Search Tree. The task is to find the <b>minimum element</b> in this given BST. If the tree is empty, there is no minimum element, so print <b>-1</b> in that case.<b>User Task:</b>
Since this will be a functional problem. You don't have to take input. You just have to complete the func... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Sara is fond of ice cream initially she had N ice creams with her. If Sara eats exactly half of the ice cream she has in a day and the remaining icecreams get tripled each night. How many ice creams does Sara have at the end of D-days?
<b>Note:- </b>
Take the floor value while dividing by 2.<b>User... | Compilable |
For this Question: Let us create a table 'STORY' from existing table 'POSTS' which will contain the information about the stories users will create on LinkedIn. This table 'story' will contain the fields (USERNAME, DATETIME_CREATED, PHOTO) of the table 'posts'
( USE ONLY UPPERCASE LETTERS FOR CODE)
<schema>[{'name':... | 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 array, A of size N and Q queries of two types:
1 U X - change the value at index U to X
2 L R - print the sum of elements in the range L to R.
Print a single integer corresponding to every query of type 2.The first line of input contains two integers N and Q denoting the number of element... | Compilable |
For this Question: Given an array, A of size N and Q queries of two types:
1 U X - change the value at index U to X
2 L R - print the sum of elements in the range L to R.
Print a single integer corresponding to every query of type 2.The first line of input contains two integers N and Q denoting the number of element... | Compilable |
For this Question: Given a singly linked list, find out the middle node of the linked list. For example, if given linked list is 1- >2- >3- >4- >5 then middle of the linked list is 3.
If there are even nodes, then there would be two middle nodes, then print both the middle elements. For example, if given linked list... | Compilable |
For this Question: An element of the matrix is called strange if its corresponding row and column contains all 1's. Given a boolean matrix of size N*M, your task is to find the number of strange elements.The first line of input contains two space-separated integers N and M. Next N lines of input contain M space-separat... | Compilable |
For this Question: An element of the matrix is called strange if its corresponding row and column contains all 1's. Given a boolean matrix of size N*M, your task is to find the number of strange elements.The first line of input contains two space-separated integers N and M. Next N lines of input contain M space-separat... | Compilable |
For this Question: An element of the matrix is called strange if its corresponding row and column contains all 1's. Given a boolean matrix of size N*M, your task is to find the number of strange elements.The first line of input contains two space-separated integers N and M. Next N lines of input contain M space-separat... | 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: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: Given a boolean matrix of size N*M in which each row is sorted your task is to print the index of the row containing maximum 1's. If multiple answer exist print the smallest one.First line contains two space separated integers denoting values of N and M. Next N lines contains M space separated intege... | Compilable |
For this Question: A shop sells candies of sweetness ranging from 1 to 1000000000. Price of a candy with sweetness X is <b>A*X + B*f(X)</b> units, where f(X) returns number of digits in the decimal notation of X. Given A, B, and T, find the candy with maximum sweetness that Andy can buy if he has T units of money. If h... | Compilable |
For this Question: A shop sells candies of sweetness ranging from 1 to 1000000000. Price of a candy with sweetness X is <b>A*X + B*f(X)</b> units, where f(X) returns number of digits in the decimal notation of X. Given A, B, and T, find the candy with maximum sweetness that Andy can buy if he has T units of money. If h... | Compilable |
For this Question: A shop sells candies of sweetness ranging from 1 to 1000000000. Price of a candy with sweetness X is <b>A*X + B*f(X)</b> units, where f(X) returns number of digits in the decimal notation of X. Given A, B, and T, find the candy with maximum sweetness that Andy can buy if he has T units of money. If h... | Compilable |
For this Question: Given an array of N integers, your task is to calculate the sum of bit difference in all pairs which can be formed.The first line of input contains a single integer N, the second line of input contains N space separated integers depicting values of the array.
Constraints:-
1 <= N <= 100000
0 <= ... | Compilable |
For this Question: Given an array of N integers, your task is to calculate the sum of bit difference in all pairs which can be formed.The first line of input contains a single integer N, the second line of input contains N space separated integers depicting values of the array.
Constraints:-
1 <= N <= 100000
0 <= ... | Compilable |
For this Question: Given an array of N integers, your task is to calculate the sum of bit difference in all pairs which can be formed.The first line of input contains a single integer N, the second line of input contains N space separated integers depicting values of the array.
Constraints:-
1 <= N <= 100000
0 <= ... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.
See the below example for a better understandingFir... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | Compilable |
For this Question: Given an array of N integers, give the number with maximum frequency. If multiple numbers have maximum frequency print the maximum number among them.The first line of the input contains an integer N, and the Second line contains N space-separated integers of the array.
<b>Constraints:</b>
3 <= N ... | Compilable |
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | Compilable |
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | Compilable |
For this Question: Joffrey has issued orders for Stark's execution. Now, you are trying to predict if Stark will survive or not. You are confident that Stark's survival depends on the N<sup>th</sup> fibonacci number's parity. If it is odd you will predict that Stark lives but if it is even you will predict that Stark d... | Compilable |
For this Question: Given a <b>BST</b> and some keys, the task is to insert the keys in the given BST. Duplicates are not inserted. (If a test case contains duplicate keys, you need to consider the first occurrence and ignore duplicates).<b>User Task:</b>
Since this will be a functional problem. You don't have to take ... | 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 an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given a stack of integers and N queries. Your task is to perform these operations:-
<b>push:-</b>this operation will add an element to your current stack.
<b>pop:-</b>remove the element that is on top
<b>top:-</b>print the element which is currently on top of stack
<b>Note:-</b>if the stack is ... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Given an array arr[] of size N and a number K, the task is to find the smallest number M such that the sum of the array becomes lesser than or equal to the number K when every element of that array is divided by the number M.
Note: Each result of the division is rounded to the nearest integer grea... | Compilable |
For this Question: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Numbers are awesome, larger numbers are more awesome!
Given an array A of size N, you need to find the maximum sum that can be obtained from the elements of the array (the selected elements need not be contiguous). You may even decide to take no element to get a sum of 0.The first line of the input ... | Compilable |
For this Question: Given an array arr[] of N integers and another integer D, your task is to perform D right circular rotations on the array and print the modified array.User task:
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>circularRotate() </b> wh... | 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: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: There are n people in a circle, numbered from 1 to n, each of whom always tells the truth or always lies.
Each person i makes a claim of the form: “the number of truth-tellers in this circle is between a<sub>i</sub> and b<sub>i</sub>, inclusive.”
Compute the maximum number of people who could be te... | Compilable |
For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: Given a matrix of N*N dimensions (Mat). Print the matrix rotated by 90 degrees and 180 degrees.The first line contains N.
N lines follow each containing N space-separated integers.
<b>Constraints</b>
2 <= N <= 100
1 <= Mat[i][j] <= 10000Output 2*N+1 lines.
First N lines should contain the Ma... | Compilable |
For this Question: Given an integer N, your task is to represent the given integer as a binary number.Input contains a single integer containing the value of N.
Constraints:-
0 <= N <= 1000000000Print a string containing the binary representation of the given integer.Sample Input:-
9
Sample Output:-
1001
Sa... | Compilable |
For this Question: Given an integer N, your task is to represent the given integer as a binary number.Input contains a single integer containing the value of N.
Constraints:-
0 <= N <= 1000000000Print a string containing the binary representation of the given integer.Sample Input:-
9
Sample Output:-
1001
Sa... | Compilable |
For this Question: Given an integer N, your task is to represent the given integer as a binary number.Input contains a single integer containing the value of N.
Constraints:-
0 <= N <= 1000000000Print a string containing the binary representation of the given integer.Sample Input:-
9
Sample Output:-
1001
Sa... | Compilable |
For this Question: Write a program to print Five stars ('*') <b><i>vertically</i></b> and 5 <b><i>horizontally</i></b>
There will be two functions:
<ul>
<li>verticalFive(): Print stars in vertical order</li>
<li>horizontalFive(): Print stars in horizontal order</l>
</ul><b>User Task:</b>
Your task is to complet... | Compilable |
For this Question: Write a program to print Five stars ('*') <b><i>vertically</i></b> and 5 <b><i>horizontally</i></b>
There will be two functions:
<ul>
<li>verticalFive(): Print stars in vertical order</li>
<li>horizontalFive(): Print stars in horizontal order</l>
</ul><b>User Task:</b>
Your task is to complet... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: N people are standing in a queue in which A of them like apple and B of them like oranges. How many people like both apple and oranges.
<b>Note</b>:- It is guaranteed that each and every person likes at least one of the given two.<b>User Task:</b>
Since this will be a functional problem, you don... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Given an array of size N, your task is to calculate the total sum of maximum and minimum elements in each subarray of size K.
See example for better understanding.First line of input contains an two space separated integers depicting values of N and K, next line contains N space separated integers d... | Compilable |
For this Question: Bob has N integers. He will divide these integers into three <b>non- empty</b> sets S1, S2 and S3.
After that bob will take one integer from each set X1, X2 and X3. It can be any integer of the set.
Variation of the distribution of integer is defined as
V = | X1 - X2 | + | X2 - X3 |
What is... | Compilable |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.