Arnab Chakraborty has Published 4173 Articles

Check whether the number formed by concatenating two numbers is a perfect square or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:59:00

240 Views

Suppose we have two numbers x and y. We have to concatenate them and check whether the resultant number is perfect square or not.So, if the input is like x = 2 y = 89, then the output will be True as after concatenating the number will be 289 which ... Read More

Check whether the number can be made perfect square after adding 1 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:58:32

597 Views

Suppose we have a number n. We have to check whether the number can be a perfect square number by adding 1 with it or not.So, if the input is like n = 288, then the output will be True as after adding 1, it becomes 289 which is same ... Read More

Check whether the length of given linked list is Even or Odd in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:57:08

245 Views

Suppose we have a linked list, we have to check whether the length of it is odd or even.So, if the input is like head = [5, 8, 7, 4, 3, 6, 4, 5, 8], then the output will be Odd.To solve this, we will follow these steps −while head ... Read More

Check whether the given numbers are Cousin prime or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:55:30

378 Views

Suppose we have a pair of integers. We have to check whether they are cousin primes or not. Two numbers are said to be cousin primes when both are primes and differ by 4.So, if the input is like pair = (19, 23), then the output will be True as ... Read More

Check whether the given number is Wagstaff prime or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:53:55

175 Views

Suppose we have a number n. We have to check whether n is Wagstaff prime or not. As we know Wagstaff prime is a prime number which is in the following form.where q is an odd prime number.So, if the input is like n = 683, then the output will ... Read More

Check whether the given number is Euclid Number or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 04:52:49

295 Views

Suppose we have a number n. We have to check whether n is Euclid number or not. As we know Euclid numbers are integer which can be represented as n= Pn+1where  is product of first n prime numbers.So, if the input is like n = 211, then the output will be ... Read More

Check whether the frequencies of all the characters in a string are prime or not in Python

Arnab Chakraborty

Arnab Chakraborty

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

253 Views

Suppose we have a string s. We have to check whether the occurrences of each character in s is prime or notSo, if the input is like s = "apuuppa", then the output will be True as there are two 'a's, three 'p's and two 'u's.To solve this, we will ... Read More

Check whether the Average Character of the String is present or not in Python

Arnab Chakraborty

Arnab Chakraborty

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

154 Views

Suppose we have a string s that contains alphanumeric characters, we have to check whether the average character of the string is present or not, if yes then return that character. Here the average character can be found by taking floor of average of each character ASCII values in s.So, ... Read More

Check whether sum of digits at odd places of a number is divisible by K in Python

Arnab Chakraborty

Arnab Chakraborty

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

163 Views

Suppose we have a number n and another number k, we have to check whether the sum of digits of n at it's odd places (from right side to left side) is divisible by k or not.So, if the input is like n = 2416 k = 5, then the ... Read More

Check whether second string can be formed from characters of first string in Python

Arnab Chakraborty

Arnab Chakraborty

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

530 Views

Suppose we have two strings s and t. We have to check whether t can be formed using characters of s or not.So, if the input is like s = "owleh" t = "hello", then the output will be True.To solve this, we will follow these steps −freq := a ... Read More

Advertisements