Q1. In a 2D MAtrix of size NxM, you start from (0,0) and travel (N-1, M-1). You can move down left and right and not up.
If the matrix node contains '.' you can move to that node and 'X' isa bloker. YOu cant visit the same node again
Find the maximum path.
Q2. There are N clients who have ordered N handmade items. The K-th client ordered exactly one item that takes T[K] hours to make. There is only one employee who makes items for clients, and he/she works in the following manner:
spend 1 hour making the first item
if the item is finished, deliver it
if the item is NOT finished, put it after ALL REMAINING ITEMS for futher work
employee then works on next item
What is the total time that clients need to wait for all ordered items?
Example: T = [3, 1, 2]
In this example, the 1st item takes 3 hours to make, the 2nd item takes 2 hours, and the 3rd item takes 2 hours. Here is how the employee goes about finishing all items: [1st, 2nd, 3rd, 1st, 3rd, 1st].
It ended up taking 6 passing hours to finish the first item, 2 passing hours the second item, and 5 passing hours for the third item. Summing all this up, we get the answer of 13.