You are given an array A consisting of N integers. A subsequence of the array is called good if every pair of elements in the subsequence have an absolute difference of at most 10.
Task
Determine the maximum possible length of good subsequence.
Example
Assumptions
Approach
Function description
Complete the function solve() which takes the following 2 parameters and returns an integer as the required answer:
Input format
Note: This is the input format you must use to provide custom input (available above the Compile and Test button).
Output format
Print the maximum possible length of good subsequence.
Constraints
1≤N≤1051≤Ai≤109
Given
Approach