Arnab Chakraborty has Published 4293 Articles

Delete Columns to Make Sorted in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Jul-2020 09:13:15

257 Views

Suppose we have an array of N lowercase letter strings, the array name is A, all strings are of same length. Now, we can choose any set of deletion indices, and for each string, we delete all the characters in those indices.As an example, if we have an array A ... Read More

DI String Match in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Jul-2020 09:12:21

280 Views

Suppose we have a string S that only contains "I" (to denote increase) or "D" (to denote decrease), let N = size of S. We have to return any permutation A of [0, 1, ..., N] such that for all i in range 0, ..., N-1 −If S[i] is "I", ... Read More

Valid Mountain Array in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Jul-2020 09:10:41

948 Views

Suppose we have an array A of integers; we have to check whether it is a valid mountain array or not. We know that A is a mountain array if and only if it satisfies the following situations − size of A >= 3There exists some index i in A ... Read More

Reorder Data in Log Files in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Jul-2020 09:10:04

429 Views

Suppose we have an array of logs. In that array each entry is a space delimited string of words. The first word in each log is an alphanumeric identifier. Then, there are different types of strings like below −Each word after the id will consist only of lowercase letters;Each word ... Read More

Program to find the HCF of two given bytes in 8085 Microprocessor

Arnab Chakraborty

Arnab Chakraborty

Updated on 06-Jul-2020 09:00:37

729 Views

Here we will see how to find the HCF or GCD of two given bytes using 8085. The numbers are 8-bit numbers, nor larger than that.Problem Statement−            Write an 8085 Assembly language program to find the HCF or GCD of two numbers stored at memory ... Read More

Number of Recent Calls in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jul-2020 10:27:37

442 Views

Suppose we want to write a class called RecentCounter to count recent requests. This class has only one method: ping(t), where t is representing some time in milliseconds. This will return the number of pings that have been made from 3000 milliseconds ago until now. Any ping with time in ... Read More

X of a Kind in a Deck of Cards in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jul-2020 10:25:58

302 Views

Suppose we have a deck of cards, each card has an integer written on it. We have to check whether we can choose X >= 2 such that it is possible to split the entire deck into 1 or more groups of cards, where the following condition satisfies: Each group ... Read More

Smallest Range I in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jul-2020 10:24:36

422 Views

Suppose we have an array A of integers, now for each integer A[i] we can choose any x with range [-K to K] then add x to A[i]. Now after this process, we have some array B. We have to find the smallest possible difference between the maximum value of ... Read More

Groups of Special-Equivalent Strings in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jul-2020 10:23:13

304 Views

Suppose we have an array of strings called A. One move onto S consists of swapping any two even indexed characters of S, or any two odd indexed characters of S.Now, two strings S and T are special-equivalent if after any number of moves onto S, S is same as ... Read More

Projection Area of 3D Shapes

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jul-2020 10:21:08

514 Views

Suppose there is a N x N grid, we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z. Here each value v = grid[i][j] is showing a tower of v cubes placed on top of grid cell (i, j). We view the ... Read More

Advertisements