import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int longestSequence(int[] a) { // Return the length of the longest possible sequence of moves. int n=a.length; int s=0; int i; for(i=0;i