|All-time Popular Problems|
|Delete without head pointer|
|Check if a number is power of another number|
|Array to BST|
|Implement Queue using Linked List|
|Lowest Common Ancestor in a BST|
|Reverse a Linked List in groups of given size.|
|Print all nodes that don’t have sibling|
|Equal to product|
The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling in those days.
First line contains number of test cases T. Each test case contain the integer value 'N' denoting days followed by an array of stock prices in N days.
The maximum profit is displayed as shown below. And if there is no profit then print "No Profit".
1 <=T<= 100
2 <=N<= 100
1 <=arr[i]<= 10000
100 180 260 310 40 535 695
23 13 25 29 33 19 34 45 65 67
(0 3) (4 6) (1 4) (5 9)
Notice: Output format is as follows - (buy_day sell_day) (buy_day sell_day)
For each input, output should be in a single line.