Save Sattu solution codechef 2021
Sattu’s friend Priya is angry with him as he didn’t help her in the previous Spider Contest. This time Sattu wants to do this question for her, so that she forgives him.
You are given an arrayof numbers from to , that is , the array has distinct numbers from to and two numbers and .
Your task is to determine subsequences such that for any 2 numbers,and , in the subsequence , 4 conditions hold always true:
Print the length of the longest subsequence which holds these conditions.
Ais a sequence that can be derived by deleting some or no elements from an Array without changing the order of the remaining elements.
Input: Save Sattu solution codechef 2021
- First line will contain , number of testcases. Then the testcases follow.
- Each testcase contains of a single line of input, three integers .
Output: Save Sattu solution codechef 2021
For each testcase, output in a single line the length of the longest subsequence which holds the above conditions.
Constraints: Save Sattu solution codechef 2021
Sample Input: Save Sattu solution codechef 2021
2 10 2 5 21 4 6
Sample Output: Save Sattu solution codechef 2021
Program Code :
We don not promote cheating in any sense, so try you best and if your want solution you can check it after a day.
ALL THE BEST.