Arnab Chakraborty has Published 4293 Articles

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

225 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

143 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

186 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

707 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

243 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

321 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

306 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

211 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

Check whether two strings are equivalent or not according to given condition in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 05:09:48

391 Views

Suppose we have two strings s and t of same size. We have to check whether s and t are equivalent or not. There are few conditions to check:They both are equal. Or, If we divide the s into two contiguous substrings of same size and the substrings are s1 ... Read More

Check whether two strings are anagram of each other in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2021 05:08:38

423 Views

Suppose we have two strings s and t we have to check whether they are anagram of each other or not.So, if the input is like s = "bite" t = "biet", then the output will be True as s ad t are made of same characters.To solve this, we ... Read More

Advertisements