Arnab Chakraborty has Published 4293 Articles

Isomorphic Strings in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:23:07

4K+ Views

Suppose we have two strings s and t; we have to check whether they are isomorphic or not. Two strings are said to be isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another character while preserving the order ... Read More

Excel Sheet Column Title in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:21:25

849 Views

Suppose we have a positive integer; we have to find its corresponding column title as appear in an Excel sheet. So [1 : A], [2 : B], [26 : Z], [27 : AA], [28 : AB] etc.So, if the input is like 28, then the output will be AB.To solve ... Read More

Pascal's Triangle II in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:19:06

341 Views

Suppose we have a non-negative index k where k ≤ 33, we have to find the kth index row of Pascal's triangle.So, if the input is like 3, then the output will be [1, 3, 3, 1]To solve this, we will follow these steps −Define an array pascal of size ... Read More

Minimum Depth of Binary Tree in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:17:28

154 Views

Suppose we have a binary tree; we have to find the minimum depth of that tree. As we know the minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.So, if the input is likethen the output will be ... Read More

Same Tree in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:11:41

398 Views

Suppose we have two binary trees; we have to define a function to check whether they are the same or not. We know that the binary trees are considered the same when they are structurally identical and the nodes have the same value.So, if the input is like [1, 2, ... Read More

Remove Duplicates from Sorted List in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:08:35

1K+ Views

Suppose we have a sorted linked list; we have to delete all duplicates such that each element appears only once.So, if the input is like [1, 1, 2, 3, 3, 3, 4, 5, 5], then the output will be [1, 2, 3, 4, 5]To solve this, we will follow these ... Read More

Length of Last Word in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:06:26

1K+ Views

Suppose we have a string s. s can hold any English letters and white-spaces. We have to find the length of last word in the string. If there is no last word, then return 0.So, if the input is like "I love Programming", then the output will be 11To solve ... Read More

Search Insert Position in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:06:01

554 Views

Suppose we have a sorted array arr and a target value, we have to find the index when the target is found. If that is not present, then return the index where it would be if it were inserted in order.So, if the input is like [1, 3, 4, 6, ... Read More

Remove Element in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 10-Jun-2020 12:04:05

213 Views

Suppose we have an array num and another value val, we have to remove all instances of that value in-place and find the new length.So, if the input is like [0, 1, 5, 5, 3, 0, 4, 5] 5, then the output will be 5.To solve this, we will follow ... Read More

Integer to English Words in Python Programming

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Jun-2020 07:37:06

2K+ Views

Suppose we have a number. The number can be anything in between 0 to 231 – 1. We have to convert the number into words. So if the number is like 512, then the result will be Five hundred twelve.To solve this, we will follow these steps −Define some lists ... Read More

Advertisements