Question: Teacher's Fun After correcting a test given to his students, a teacher was bored and wanted to know the maximum number of students that had
Teacher's Fun
After correcting a test given to his students, a teacher was bored and wanted to know the maximum number of students that had scores equal or close to others by a maximum of one point:
Considering an array of scores, scores, a number is defined as the size of some subsequence, of scores where each element covers an unbroken range of integers. That is to say, if you were to sort the elements in the absolute difference between any elements and would be either or Determine the maximum length of a subsequence chosen from the scores array.
Example
scores
Valid subsequences, sorted, are and These subsequences have values of and respectively. Return
Function Description
Complete the function maxSubsequence in the editor below.
Language Java
Autocomplete F
import
java.io;
class Result
Complete the 'maxsubsequence' function below.
The function is expected to return an INTEGER.
The function accepts INTEGERARRAY scores as parameter.
pubtic static int maxsubsequenceList
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
