Arnab Chakraborty has Published 4452 Articles

Max Difference You Can Get From Changing an Integer in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 12:12:39

125 Views

Suppose we have an integer num. We will apply the following steps exactly two times, the steps are like −Pick a digit x in range 0 to 9.Pick another digit y also in range 0 to 9. The digit y can be equal to x.Replace all the occurrences of x ... Read More

Maximum Points You Can Obtain from Cards in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 12:10:01

233 Views

Suppose there are several cards arranged in a row, each card has associated points, and these points are given in the integer array called cardPoints. In one step, we can take one card from the beginning or from the end of the row. We have to take exactly k cards. ... Read More

Diagonal Traverse II in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 12:08:03

102 Views

Suppose we have a list of lists called nums, we have to show all elements of nums in diagonal order.So, if the input is likethen the output will be [1, 6, 2, 8, 7, 3, 9, 4, 12, 10, 5, 13, 11, 14, 15, 16]To solve this, we will follow ... Read More

Minimum Number of Frogs Croaking in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 12:03:01

159 Views

Suppose we have a string called croakOfFrogs, this represents a combination of the string "croak" from different frogs, multiple frogs can croak at the same time, so multiple "croak" are mixed. We have to find the minimum number of different frogs to finish all the croak in the given string.Here ... Read More

Display Table of Food Orders in a Restaurant in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 12:00:26

259 Views

Suppose we have an array orders, which represents the orders that customers have done in a restaurant. So, orders[i]=[cust_namei, table_numi, food_itemi] where cust_namei is the customer name, table_numi is the customers table number, and food_itemi is the item customer orders.We have to return the restaurant's “display table”. Here the “display ... Read More

The k-th Lexicographical String of All Happy Strings of Length n in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 11:56:29

139 Views

Suppose we have a string. We will call that a happy string when it consists of only ['a', 'b', 'c'] letters, and s[i] != s[i + 1] for all values of i from 1 to length of s - 1 (here the string is 1-indexed).So, if we have two integers ... Read More

Find the Minimum Number of Fibonacci Numbers Whose Sum Is K in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 11:54:40

426 Views

Suppose we have a number k, we have to find the minimum number of Fibonacci numbers whose sum is equal to the k, whether a Fibonacci number could be used multiple times.So, if the input is like k = 7, then the output will be 2, as the Fibonacci numbers ... Read More

HTML Entity Parser in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 11:53:33

540 Views

Suppose we have a string; we have to design one HTML parser that will replace the special character of HTML syntax into normal character. The HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself. ... Read More

Queries on a Permutation With Key in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 11:48:54

96 Views

Suppose we have an array queries of positive integers between 1 and m, we have to process all queries, queries[i] (from i=0 to n, n is the size of queries - 1) according to the following rules −At the beginning, we have the permutation P=[1, 2, 3, ..., m].For the ... Read More

Longest Happy String in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Nov-2020 11:46:48

515 Views

Suppose there is a string. That string is called happy if it does not have any of the strings like 'aaa', 'bbb' or 'ccc' as a substring. If we have three integers like a, b and c, then return any string s, which satisfies the following conditions −s is happy ... Read More

Advertisements