Arnab Chakraborty has Published 4452 Articles

Check if a number can be expressed as a^b in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:46:15

295 Views

Suppose we have a number n. We have to check whether we can make express it like a^b or not.So, if the input is like 125, then the output will be True as 125 = 5^3, so a = 5 and b = 3To solve this, we will follow these ... Read More

Check whether right angled triangle is valid or not for large sides in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:45:16

477 Views

Suppose we have three sides in a list. We have to check whether these three sides are forming a right angled triangle or not.So, if the input is like sides = [8, 10, 6], then the output will be True as (8^2 + 6^2) = 10^2.To solve this, we will ... Read More

Check whether product of integers from a to b is positive, negative or zero in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:43:56

123 Views

Suppose we have lower limit and upper limit of a range [l, u]. We have to check whether the product of the numbers in that range is positive or negative or zero.So, if the input is like l = -8 u = -2, then the output will be Negative, as ... Read More

Check whether product of digits at even places of a number is divisible by K in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:42:45

84 Views

Suppose we have a number n, and another number k, we have to check whether the product of digits at even places of n is divisible by k or not. Places are started counting from right to left. Right most is at place 1.So, if the input is like n ... Read More

Check whether product of digits at even places is divisible by sum of digits at odd place of a numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:42:05

450 Views

Suppose we have a number n, we have to check whether the product of digits at even places of n is divisible by sum of digits at odd place of n or not. Places are started counting from right to left. Right most is at place 1.So, if the input ... Read More

Check whether product of 'n' numbers is even or odd in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:38:51

368 Views

Suppose we have an array nums. We have to check whether the product of these numbers is even or odd.So, if the input is like nums = [5, 7, 4, 2, 6], then the output will be Even, as the multiplication is 1680 and this is even.To solve this, we ... Read More

Check whether N is a Dihedral Prime Number or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:38:01

142 Views

Suppose we have a number n. We have to check whether n is dihedral prime or not. A number is said to be dihedral prime when that number is itself prime and also shown same number or any other prime number using 7-segment display regardless the orientation of the display ... Read More

Check whether K-th bit is set or nots in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:36:45

2K+ Views

Suppose we have a number n and another value k. We have to check whether the kth bit in n is set (1) or not. The value of k is considered from right hand side.So, if the input is like n = 23, k = 3, then the output will ... Read More

Check whether it is possible to make both arrays equal by modifying a single element in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:35:12

140 Views

Suppose we have two arrays nums1 and nums2 and another value k. We have to check whether both arrays can be made equal by modifying any one element from the nums1 in the following way (only once): We can add any value from the range [-k, k] to any element ... Read More

Check whether given three numbers are adjacent primes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:34:09

123 Views

Suppose we have three numbers and we have to check whether they are adjacent primes are not. The adjacent primes are prime numbers where no other prime is present between them.So, if the input is like nums = [5, 7, 11], then the output will be True.To solve this, we ... Read More

Advertisements