Arnab Chakraborty has Published 4293 Articles

Minimum Difficulty of a Job Schedule in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:31:55

369 Views

Suppose we want to schedule a list of tasks in d days. The tasks are dependent so, to work on the i-th task, we have to finish all the tasks j where 0 0, then −return 1^6if dp[idx, k] is not equal to -1, then −return dp[idx, k]maxVal := ... Read More

Reverse Subarray To Maximize Array Value in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:29:31

542 Views

Suppose we have one integer array called nums. The value of this array is defined as the sum of |nums[i]-nums[i+1]| for all i in range 0 to n - 1. Where n is the size of the array. We can select any subarray of the given array and reverse it. ... Read More

Minimum Number of Taps to Open to Water a Garden in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:26:15

363 Views

Suppose there is a one-dimensional garden on the x-axis. The starting position of the garden is 0, and ending position is n. There are n + 1 taps located at points [0, 1, ..., n] in the garden. If we have an integer n and an integer array ranges of ... Read More

Minimum Distance to Type a Word Using Two Fingers in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:25:38

265 Views

Suppose we have a keyboard layout like below −ABCDEFGHIJKLMNOPQRSTUVWXYZWhere each English uppercase letter is located at some coordinate, as an example, the letter A is placed at (0, 0), the letter B is placed at (0, 1), the letter P is placed at (2, 3) and the letter Z is ... Read More

Distinct Echo Substrings in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:21:01

172 Views

Suppose we have a string S; we have to find the number of distinct non-empty substrings of S that can be written as the concatenation of some string with itself.So, if the input is like "elloelloello", then the output will be 5, as there are some substrings like "ello", "lloe", ... Read More

Verbal Arithmetic Puzzle in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:17:12

490 Views

Suppose we have an equation, expressions are represented by words on left side and the result on right side. We have to check whether the equation is solvable under the following rules or not −Each character is decoded as one digit (0 to 9).Every pair of different characters must map ... Read More

Number of Paths with Max Score in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:13:26

190 Views

Suppose we have a square board of characters. We can move on the board starting at the bottom right square marked with the character 'S'. Now we need to reach the top left square marked with the character 'E'. The other squares are labeled either with a numeric character from ... Read More

Maximum Candies You Can Get from Boxes in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:09:37

397 Views

Suppose we have n boxes, here each box is given in the format like [status, candies, keys, containedBoxes] there are some constraints −status[i]: an is 1 when box[i] is open and 0 when box[i] is closed.candies[i]: is the number of candies in box[i].keys[i]: is an array contains the indices of ... Read More

Shortest Path in a Grid with Obstacles Elimination in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:07:14

600 Views

Suppose we have a m x n grid, here each cell is either 0 or 1. 0 cell is empty and 1 is blocked. In one step, we can move up, down, left or right from and to an empty cell. We have to find the minimum number of steps ... Read More

Minimum Falling Path Sum II in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Jun-2020 11:04:09

299 Views

Suppose we have a grid arr, this is a square grid, a falling path with non-zero shifts is a choice of exactly one element from each row of arr, such that no two elements chosen in adjacent rows are present in the same column. We have to find the minimum ... Read More

Advertisements