Arnab Chakraborty has Published 4293 Articles

Maximum Score Words Formed by Letters in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:50:43

260 Views

Suppose we have a list of words, a list of single letters and score for every character. We have to find the maximum score of any valid set of words formed by using the given letters.We may not use all characters in letters and each letter can only be used ... Read More

Check If It Is a Good Array in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:47:28

2K+ Views

Suppose we have an array called nums of positive integers. We have to select some subset of nums, then multiply each element by an integer and add all these numbers. The array will be a good array if we can get a sum of 1 from the array by any ... Read More

Tiling a Rectangle with the Fewest Squares in C++

Arnab Chakraborty

Arnab Chakraborty

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

311 Views

Suppose we have a rectangle of size n x m. We have to find the minimum number of integers sided square objects that can tile the rectangles.So, if the input is like n = 2 and m = 3, then the output will be 3, as we need three blocks.To ... Read More

Maximum Profit in Job Scheduling in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:41:34

1K+ Views

Suppose we have n different tasks, where every task is scheduled to be done from startTime[i] to endTime[i], for that task we algo get profit of profit[i]. We know the startTime , endTime and profit lists, we have to find the maximum profit we can take such that there are ... Read More

Maximum Equal Frequency in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:37:43

270 Views

Suppose we have an array nums of positive integers, we have to return the longest possible length of an array prefix of given array nums, such that it is possible to delete exactly one element from this prefix so that every number that has appeared in it will have the ... Read More

Count Vowels Permutation in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:34:36

285 Views

Suppose we have one number n, we have to count how many strings of length n can be formed using these rules − Each character is a lower case vowel Each vowel 'a' may only be followed by an 'e'. Each vowel 'e' may only be followed by an 'a' ... Read More

Critical Connections in a Network in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:31:44

497 Views

Suppose there are n servers. And these are numbered from 0 to n-1 connected by an undirected server-to-server connections forming a network where connections[i] = [a, b] represents a connection between servers a and b. All servers are connected directly or through some other servers. Now, a critical connection is ... Read More

Make Array Strictly Increasing in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:27:45

404 Views

Suppose we have two arrays arr1 and arr2, these can store integer numbers. We have to find the minimum number of operations needed to make arr1 strictly increasing. Here, we can choose two indices 0 size of arr2, then -1, otherwise ret - 1)Let us see the following implementation ... Read More

Last Substring in Lexicographical Order in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:24:58

301 Views

Suppose we have s as string, we have to find the last substring of s in lexicographic order.So, if the input is like "abbbcabbc", then the output will be "cabbc"To solve this, we will follow these steps −i := 0, j := 1, k := 0while j + k < ... Read More

Longest Chunked Palindrome Decomposition in python

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Jun-2020 11:23:32

290 Views

Suppose we have a text. We have to find the largest possible k such that there exists a[1], a[2], ..., a[k] such that: Each a[i] is a non-empty string; Their concatenation a[1] + a[2] + ... + a[k] is equal to the given text; For all i in range 1 ... Read More

Advertisements