Company: ClearTax
Difficulty: medium
Investment Strategy Analysis C++ 14 Wael has a unique investment strategy. He will give you an opportunity to invest with him on some days. However, there are some conditions that must be met: The investment on i th day must be made. He can invest on day j after investing on day i only if i + j ≤ D. Wael allows you to invest with him if A[i] is strictly larger than all A[j] days in which he had previously invested for all days (i ≤ j ≤ N). You need to find the maximum possible number of days on which you can invest with him. Function Description Complete the invest function in the editor below. It has the following parameter(s): Name Type Description N INTEGER The number of days. D INTEGER The described integer D. A INTEGER ARRAY The array describing earnings at each day. Return Value The function must return an INTEGER denoting the maximum possible number of days on which Wael will allow you to invest with him. Code Template #include <bits/stdc++.h> using namespace std; string t