Arnab Chakraborty has Published 4293 Articles

Program to find out the efficient way to study in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:51:27

96 Views

Suppose, we have three lists whose lengths are same. These are deadlines, credits, and durations. They are representing course assignments. For the i−th assignment deadlines[i] shows its deadline, credits[i] shows its credit, and durations[i] shows the number of days it takes to finish the assignment. One assignment must be completed ... Read More

Program to find maximum value by inserting operators in between numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:49:50

346 Views

Suppose we have a list of numbers called nums, we have to find the maximal value that can be generated by adding any binary operators like +, −, and * between the given numbers as well as insert any valid brackets.So, if the input is like nums = [−6, −4, ... Read More

Program to find number of ways we can concatenate words to make palindromes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:47:31

184 Views

Suppose we have a list of distinct words, we have to find the number of different ways we can concatenate two different words from the given list of words to make a palindrome.So, if the input is like words = ["time", "emit", "mo", "m"], then the output will be 3, ... Read More

Program to find max values of sublists of size k in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:43:55

190 Views

Suppose we have a list nums and another value k, we have to find the maximum values of each sublist of size k.So, if the input is like nums = [12, 7, 3, 9, 10, 9] k = 3, then the output will be [12, 9, 10, 10]To solve this, ... Read More

Program to find length of longest sublist whose sum is 0 in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:41:36

139 Views

Suppose we have a list with only two values 1 and −1. We have to find the length of the longest sublist whose sum is 0.So, if the input is like nums = [1, 1, −1, 1, 1, −1, 1, −1, 1, −1], then the output will be 8, as ... Read More

Program to find length of longest substring which contains k distinct characters in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:39:26

755 Views

Suppose we have a number k and another string s, we have to find the size of the longest substring that contains at most k distinct characters.So, if the input is like k = 3 s = "kolkata", then the output will be 4, as there are two longest substrings ... Read More

Program to find length of longest substring with even vowel counts in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:36:37

418 Views

Suppose we have a string s (lowercase), we have to find the length of the longest substring where each vowel occurs even number of times.So, if the input is like s = "anewcoffeepot", then the output will be 10, as the substring "wcoffeepot" has two vowels "o" and "e", both ... Read More

Program to find length of longest palindromic substring after single rotation in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:34:46

219 Views

Suppose we have a string s, which we can rotate at any point exactly once. We have to find the length of the longest palindromic substring we can get by doing this operation.So, if the input is like s = "elklev", then the output will be 7, as we can ... Read More

Program to find longest prefix that is also a suffix in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 15-Dec-2020 12:33:08

543 Views

Suppose we have a string s, we have to find the longest prefix of s, which is also a suffix (excluding itself). If there is no such prefix, then simply return blank string.So, if the input is like "madam", then the output will be "m", it has 4 prefixes excluding ... Read More

Program to find length of the longest path in a DAG without repeated nodes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 12-Dec-2020 10:47:33

1K+ Views

Suppose we have one directed acyclic graph represented by the adjacency list. We have to find the longest path in the graph without node repetition.So, if the input is likethen the output will be 4, as the path is 0 -> 1 -> 3 -> 4 -> 2 with length ... Read More

Advertisements