Arnab Chakraborty has Published 4452 Articles

Check if all digits of a number divide it in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:43:36

511 Views

Suppose we have a number n. We have to check whether all digits of it can divide n or not.So, if the input is like n = 135, then the output will be True, because (135 / 1 = 135), (135 / 3 = 45) and (135 / 5 = ... Read More

Check if all bits of a number are set in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:42:19

293 Views

Suppose we have a number n. We have to check whether all bits are set (1) for the given number n or not.So, if the input is like n = 255, then the output will be True as the binary representation of 255 is 11111111.To solve this, we will follow ... Read More

Check if a two-character string can be made using given words in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:36:45

93 Views

Suppose we have a string s of length 2, and also have a list of words w where all words are of length 2. We have to check whether we can concatenate words from w and that concatenated string contains s as substring or not.So, if the input is like ... Read More

Check if a triangle of positive area is possible with the given angles in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:28:56

761 Views

Suppose we have three angles. We have to check whether it is possible to create a triangle of positive area with these angles or not.So, if the input is like a = 40 b = 120 c = 20, then the output will be True as the sum of 40 ... Read More

Check if a string is the typed name of the given name in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:27:45

418 Views

Suppose we have two lowercase strings s and t. Sometimes, when we type a vowel, the key might get long pressed, and the vowel will be repeated 1 or more times. We have to check whether it is possible that t is typed that indicates s or not.So, if the ... Read More

Check if a string is suffix of another in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:26:12

325 Views

Suppose we have two strings s and t. We have to check whether s is suffix of t or not.So, if the input is like s = "ate" t = "unfortunate", then the output will be True.To solve this, we will follow these steps −s_len := size of st_len := ... Read More

Check if a string is palindrome in C using pointers

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:24:43

7K+ Views

Suppose we have a string s. We have to check whether the given string is a palindrome or not. We have to solve this problem using pointers in C.So, if the input is like s = "racecar", then the output will be True.To solve this, we will follow these steps ... Read More

Check if a string is Isogram or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:22:20

2K+ Views

Suppose we have a string s. We have to check whether the given string is isogram or not. The isogram is a string where the occurrence of each letter is exactly one.So, if the input is like s = "education", then the output will be True because all characters in ... Read More

Check if a string is Colindrome in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:20:38

280 Views

Suppose we have a string s. We have to check whether the given string is colindrome or not. The colindrome is a concatenated string of 6 length palindromes.So, if the input is like s = "aabbaamnoonm", then the output will be True as this contains palindromes like "aabbaa" and "mnoonm", ... Read More

Check if a string has m consecutive 1s or 0s in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Dec-2020 13:17:33

452 Views

Suppose we have a binary string s and another value m, we have to check whether the string has m consecutive 1’s or m consecutive 0’s.So, if the input is like s = "1110111000111", m = 3, then the output will be True as there are three consecutive 0s and ... Read More

Advertisements