To solve the analytical problems and code it
Jig is having a birthday! She will have a cake with one candle for each year of her age. When she blows out the candles, she’ll only be able to blow out the tallest ones.
❓ Find and print the number of candles she can successfully blow out.
There is a collection of N strings ( There can be multiple occurences of a particular string ). Each string's length is no more than 20 characters. There are also Q queries.
❓ For each query, you are given a string, and you need to find out how many times this string occurs in the given collection of N strings.
Input Format
The first line contains N, the number of strings. The next N lines each contain a string. The N+2 nd line contains , the number of queries. The following Q lines each contain a query string.
You are given a list(1-indexed) of size n, initialized with zeroes. You have to perform m operations on the list and output the maximum of final values of all the n elements in the list.
❓ For every operation, you are given three integers a, b and k and and you have to add value k to all the elements ranging from index to (both inclusive).
For example, consider a list of size 3. The initial list would be a = [0, 0, 0] and after performing the update 0(a, b, k) = (2,3,30), the new list would be a = [0, 30, 30]. Here, we've added value 30 to elements between indices 2 and 3. Note the index of the list starts from 1.