Arnab Chakraborty has Published 4293 Articles

Find Numbers with Even Number of Digits in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:24:34

2K+ Views

Suppose we have a list of numbers. We have to count the numbers that has even number of digit count. So if the array is like [12, 345, 2, 6, 7896], the output will be 2, as 12 and 7896 has even number of digitsTo solve this, we will follow ... Read More

Partition Labels in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:23:37

399 Views

Suppose we have a string S of lowercase letters is given. We will partition this string into as many parts as possible so that each letter appears in at most one part, finally return a list of integers representing the size of these parts. So if the string is like ... Read More

Element Appearing More Than 25% In Sorted Array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:21:52

277 Views

Suppose we have an array A. There are few elements. Some elements are common. We have to return an element that is appearing more than 25% spaces in the array. So if A = [1, 2, 4, 4, 4, 4, 5, 5, 6, 6, 7, 7], Here 4 has occurred ... Read More

Daily Temperatures in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:20:55

986 Views

Suppose we have a list of daily temperatures T, we have to return a list such that, for each day in the input, shows how many days we would have to wait until a warmer temperature. If there is no future day for which this is possible, store 0 instead. ... Read More

Subtract the Product and Sum of Digits of an Integer in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:19:46

487 Views

Suppose we have one number. We have to find the sum of digits and product of digits. After that find the difference between sum and product. So if the number is 5362, then sum is 5 + 3 + 6 + 2 = 16, and 5 * 3 * 6 ... Read More

Subarray Product Less Than K in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:17:39

357 Views

Suppose we have given an array of positive integers nums. We have to count and print the number of (contiguous) subarrays where the product of each the elements in the subarray is less than k. So if the input is like [10, 5, 2, 6] and k := 100, then ... Read More

Minimum Time Visiting All Points in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:17:15

234 Views

Suppose there are some points given as an array. We have to find the minimum time in seconds to visit all points. There are some conditions.In one second, it can move vertically, horizontally and diagonallyWe have to visit the points in the same order as they appear in the array.So ... Read More

Cells with Odd Values in a Matrix in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:14:01

356 Views

Suppose there are n and m which are the dimensions of a matrix. These are initialized by zeros. And indices are given where indices[i] = [ri, ci]. For each pair of [ri, ci] we have to increment all cells in row ri and column ci by 1. The output will ... Read More

Minimum ASCII Delete Sum for Two Strings in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:12:07

446 Views

Suppose we have two words w1 and w2, we have to find the lowest ASCII sum of deleted characters to make w1 and w2 the same, where in each step we can delete one character in either string. So if the input is like “sea” and “eat”, then the output ... Read More

Find Positive Integer Solution for a Given Equation in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Apr-2020 08:11:04

277 Views

Suppose we have a function f that takes two parameters (x, y). We have to return all pairs of x and y, for which f(x, y) = z. The z is given as input, and x, y are positive integers. The function is constantly increasing function. So f(x, y) < ... Read More

Advertisements