Question: Please code in java Lucky days You are given the price of a stock for N days. Each day you will sell the stock at

Please code in java

Please code in java Lucky days You are given the price ofa stock for N days. Each day you will sell the stock

Lucky days You are given the price of a stock for N days. Each day you will sell the stock at the price of current day price. You consider yourself lucky if after selling the stock the th day, you never encounter any day after it that has a price higher than the current day's price. You need to tell on how many days you were lucky. Input format The first line contains T denoting the number of test cases. Now, 2 x T lines follow. For each test case, the first line contains N denoting the number of days. For each test case, the next line contains N space-separated integers denoting prices for ith days as pricez. Output format For each test case, print the number of days you got lucky in a new line. Constraints 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!