Arnab Chakraborty has Published 4173 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

394 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

817 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

256 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

163 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

627 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 N is a Dihedral Prime Number or not in Python

Arnab Chakraborty

Arnab Chakraborty

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

275 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

3K+ 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

262 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

215 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

Check whether given string can be generated after concatenating given strings in Python

Arnab Chakraborty

Arnab Chakraborty

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

190 Views

Suppose we have two strings s and t and r, we have to check whether r = s | t or r = t + s where | denotes concatenation.So, if the input is like s = "world" t = "hello" r = "helloworld", then the output will be True ... Read More

Advertisements