Arnab Chakraborty has Published 4293 Articles

Coincidence Search in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:44:29

240 Views

Suppose we have a list of unique integers called nums. We have to find the number of integers that could still be successfully found using a standard binary search.So, if the input is like [2, 6, 4, 3, 10], then the output will be 3, as if we use binary ... Read More

Palindrome Integer in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:42:36

227 Views

Suppose we have a non-negative integer called num, we have to check whether it is a palindrome or not, but not using a string.So, if the input is like 1331, then the output will be true.To solve this, we will follow these steps −ret := 0x := numwhile num > ... Read More

Flipped Matrix Prequel in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:40:41

271 Views

Suppose we have one binary matrix. We have to find the maximum number of 1s we can get if we flip a row and then flip a column.So, if the input is like101010100then the output will be 8To solve this, we will follow these steps −n := size of rows ... Read More

Furthest From Origin in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:38:02

680 Views

Suppose we have a string s where each character is either "L", "R" or "?". "L" means moved one unit left, "R" means moved one unit right, and "?" means either "L" or "R". If we are at position 0, we have to find the maximum possible distance we could ... Read More

Flip to Zeros in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:36:25

407 Views

Suppose we have one integer array called nums and this contains 0s and 1s. Suppose we have an operation where we pick an index i in nums and flip element at index i as well as all numbers to the right of i. We have to find the minimum number ... Read More

Split List in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:33:00

1K+ Views

Suppose we have a list of integers called nums, we have to find whether we can partition the list into two sublists (non-empty) such that every number in the left part is strictly less than every number in the right part.So, if the input is like [6, 4, 3, 8, ... Read More

Contained Interval in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:31:05

383 Views

Suppose we have a two-dimensional list of intervals where each interval has two values [start, end]. We have to find whether there's an interval which contains another interval.So, if the input is like [[2, 4], [5, 11], [5, 9], [10, 10]], then the output will be true as [5, 11] ... Read More

Making List Values Equal in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:28:51

168 Views

Suppose we have a list of integers called nums. Now suppose an operation where we select some subset of integers in the list and increment all of them by one. We have to find the minimum number of required operations to make all values in the list equal to each ... Read More

Longest Interval Containing One Number in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 11:27:25

170 Views

Suppose we have a list of distinct integers called nums. We have to find the size of the largest interval (inclusive) [start, end] such that it contains at most one number in nums.So, if the input is like nums = [10, 6, 20], then the output will be 99990, as ... Read More

Find bitonic point in given bitonic sequence in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 28-Aug-2020 12:14:27

572 Views

Suppose we have a bitonic sequence, we have to find the Bitonic Point in it. As we know a Bitonic Sequence is a sequence of numbers which is first strictly increasing then after a certain point it is strictly decreasing. This point is bitonic point. For only increasing or only ... Read More

Advertisements