Arnab Chakraborty has Published 4452 Articles

Check if at least half array is reducible to zero by performing some operation in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 12:15:47

59 Views

Suppose, we are provided with a list of size n that contains positive integers and another positive integer m. Let's say, we are currently inside a loop and in each iteration, we decrease the value of some elements in the array by 1 and increase the value of the remaining ... Read More

Check if all rows of a matrix are circular rotations of each other in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 12:12:28

137 Views

Suppose, we are provided with a matrix of the size n*n, containing integer numbers. We have to find out if all the rows of that matrix are circular rotations of its previous row. In case of first row, it should be a circular rotation of the n-th row.So, if the ... Read More

Check if all levels of two trees are anagrams or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 12:09:11

140 Views

Suppose, we are provided with two binary trees. We have to check if each level of a binary tree is an anagram of the other binary tree's same level. We return True if it is an anagram, otherwise we return False.So, if the input is like, then the output will ... Read More

Check if absolute difference of consecutive nodes is 1 in Linked List in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 12:04:45

86 Views

Suppose, we have a singly linked list where each node contains an integer value. We have to find out if the absolute difference between two successive nodes is 1.So, if the input is like start_node->5->6->7->8->7->6->5->4, then the output will be True.To solve this, we will follow these steps −temp := ... Read More

Check if a triplet with given sum exists in BST in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 12:00:51

94 Views

Suppose, we are provided with a Binary Search Tree (BST) that contains integer values, and a number 'total'. We have to find out if there are any group of three elements in the provided BST where the addition of the three elements is equal to the supplied 'total' value.So, if ... Read More

Check if a word exists in a grid or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 11:59:28

548 Views

Suppose, we have a grid or a matrix of words. We have to check whether a given word is present in the grid or not. The word can be found in four ways, horizontally left and right and vertically up and down. If we can find the word we return ... Read More

Check if a string is Pangrammatic Lipogram in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 11:53:46

120 Views

Suppose, we have been provided with three strings and we are asked to find which of the strings are a Pangram, Lipogram, and a Pangrammatic Lipogram. A Pangram is a string or a sentence, where every letter in the alphabet appears at least once. A Lipogram is a string or ... Read More

Check if a string follows anbn pattern or not in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 11:49:45

247 Views

Suppose, we are given a string that is made of only two letters a and b. We have to find out if the string is of the form anbn, or in other words it contains n number of a's followed by n number of b's. If true, we return 1 ... Read More

Check if a string contains a palindromic sub-string of even length in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 11:46:50

216 Views

Suppose, we are given a string that contains only lowercase letters. Our task is to find if there exists a substring in the given string that is a palindrome and is of even length. If found, we return 1 otherwise 0.So, if the input is like "afternoon", then the output ... Read More

Check if a string can become empty by recursively deleting a given sub-string in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 18-Jan-2021 11:45:26

143 Views

Suppose, we are given two strings, str1 and str2. str2 is a substring of str1, and we can delete str2 from str1. It is possible, that the string str2 appears multiple times in str1. Our goal here is to find out if str1 becomes a null string if we keep ... Read More

Advertisements