Arnab Chakraborty has Published 4293 Articles

Jump Game II in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 12:01:30

888 Views

Suppose we have one array of integers, where all elements are positive. The initial starting point is at index 1. Each element in the array represents our maximum jump length at that position. Our goal is to reach to the final cell with less number of jumps. So if the ... Read More

Wildcard Matching in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:58:18

4K+ Views

Suppose we have an input string s and another input string p. Here is the main string and p is the pattern. We have to define one method, that can match pattern in the string. So we have to implement this for a regular expression, that supports wildcard characters like ... Read More

Trapping Rain Water in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:55:41

1K+ Views

Suppose we have an array of n non-negative integers. These are representing an elevation map where the width of each bar is 1, we have to compute how much water it is able to trap after raining. So the map will be like −Here we can see there are 6 ... Read More

First Missing Positive in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:51:41

895 Views

Suppose we have one unsorted integer array; we have to find the smallest missing positive number. So if the array is like [4, -3, 1, -1], then the result will be 2.To solve this, we will follow these steps −set i := 0 and update array nums by adding one ... Read More

Sudoku Solver in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:48:01

17K+ Views

Suppose we have a Sudoku grid and we have to solve this famous number maze problem, Sudoku. We know that Sudoku is a 9 x 9 number grid, and the whole grid are also divided into 3 x 3 boxes There are some rules to solve the Sudoku.We have to ... Read More

Longest Valid Parentheses in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:41:17

1K+ Views

Suppose we have a string, with opening and closing parentheses. We have to find the longest length of the valid (well-formed) parentheses. So if the input is like “))(())())”, then the result will be 6, as the valid string is “(())()”.To solve this, we will follow these steps −Make a ... Read More

Substring with Concatenation of All Words in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:38:04

180 Views

Suppose we have a string, s, and we also have a list of words, words present in the array are all of the same length. We have to find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any ... Read More

Reverse Nodes in k-Group in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:34:39

265 Views

Suppose we have a linked list, we have to reverse the nodes of the linked list k at a time and return its modified list. Here k is a positive integer and is less than or equal to the length of the linked list. So if the number of nodes ... Read More

Merge k Sorted Lists in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:30:07

952 Views

Suppose we have some lists, these are sorted. We have to merge these lists into one list. To solve this, we will use the heap data structure. So if the lists are [1, 4, 5], [1, 3, 4], [2, 6], then the final list will be [1, 1, 2, 3, ... Read More

Regular Expression Matching in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 26-May-2020 11:20:39

514 Views

Suppose we have an input string s and another input string p. Here s is the main string and p is the pattern. We have to define one method, that can match patterns in the string. So we have to implement this for a regular expression, that supports ‘.’ And ... Read More

Advertisements