Create line chart for mean covered with minimum and maximum in R.

Nizamuddin Siddiqui
Published on 25-Oct-2021 09:08:50
To create line chart for mean covered with minimum and maximum in R, we first need to create columns for row means, row minimum, and row maximum after that geom_line function can be used along with geom_ribbon function of ggplot2 package as shown in the below example.ExampleFollowing snippet creates a ... Read More

Program to find coefficients of linear equations that has only one solution in Python

Arnab Chakraborty
Published on 25-Oct-2021 08:11:57
Suppose we have a value n, we have to find the number of pairs (a, b) [a < b], that exist such that the equation a*x + b*y = n, has at least one solution.So, if the input is like n = 4, then the output will be 2 because ... Read More

Program to find number m such that it has n number of 0s at end in Python

Arnab Chakraborty
Published on 25-Oct-2021 08:08:24
Suppose we have a number n. We have to find smallest number m, such that factorial of m has at least n number of 0s.So, if the input is like n = 2, then the output will be 10 because 10! = 3628800 and 9! = 362880, minimum number with ... Read More

Program to find hoe many children will get candies while distributing them maintaining the rules in Python

Arnab Chakraborty
Published on 25-Oct-2021 08:05:08
Suppose we have k number of candies. We have to distribute them among children. Now there are some rulesith child will get i^2 number of candiesany children at index i will not get any candy until all children from index 1 to i-i are servedIf ith children does not get ... Read More

Program to find remainder after dividing n number of 1s by m in Python

Arnab Chakraborty
Published on 25-Oct-2021 08:02:07
Suppose we have two numbers n and m. We have to find the remainder after dividing n number of 1s by m.So, if the input is like n = 4 m = 27, then the output will be 4, because 1111 mod 27 = 4.To solve this, we will follow ... Read More

Program to find number of pairs from N natural numbers whose sum values are divisible by k in Python

Arnab Chakraborty
Published on 25-Oct-2021 07:59:43
Suppose we have a number n and another value k, consider we have an array A with first N natural numbers, we have to find the total number of pairs of elements A[i] and A[j] from A, such that, i < j and their sum is divisible by k.So, if ... Read More

Program to find common fraction between min and max using given constraint in Python

Arnab Chakraborty
Published on 25-Oct-2021 07:55:26
Suppose we have two long integer values maximum and minimum. We have to find a common fraction n/d such that min <= d <= max. And |n/d - pi| is smallest. Here pi = 3.14159265... and if there are more than one fractions holding this condition, then return the fraction ... Read More

Program to find probability that any proper divisor of n would be an even perfect square number in Python

Arnab Chakraborty
Published on 25-Oct-2021 07:50:08
Suppose we have a number n, we have to find out the probability that any proper divisor of n would be an even perfect square.So, if the input is like n = 36, then the output will be 1/8 because there are eight proper divisors of 36, these are {1, ... Read More

Program to find value of find(x, y) is even or odd in Python

Arnab Chakraborty
Published on 25-Oct-2021 07:43:58
Suppose we have an array nums. We also have another pair (x, y), we need to find whether the value find(x, y) is Odd or Even. The find() is as followsfind(x, y) = 1 if x > yfind(x, y) = nums[x]^find(x+1, y) otherwiseSo, if the input is like nums = ... Read More

Program find number of subsets of colorful vertices that meets given conditions in Python

Arnab Chakraborty
Published on 25-Oct-2021 07:41:12
Suppose we have an array colors, representing colors for one regular n-gon. Here each vertex of this n-gon was randomly colored with one of n different colors present in the given array. We have to find the number of special subsets of polygon vertices, such that these subsets meet these ... Read More
1 2 3 4 5 6 7 ... 5726 Next
Advertisements