To print longest pattern sequence
Problem: Write a program to print longest pattern sequence. e.g. Input String str="123424861234567"; Patterns are "1234","2486","1234567" with common difference 1,2,1 respectively.So being the longest third pattern i.e. "1234567" is the output. package assignment1; /** * @author snlkjha */ public class Str { public static void lognest_str_pattern(char s[]){ int count1[]=new int[5],count2[]=new int[5],t=0,max=0,i,j; // Variable declaration for(i=0;i<s.length;i=i+j+1){ j=0; while((i+j+1)<s.length && (s[i+j+1]-'0')-(s[i+j]-'0')==((s[i+1]-'0')-(s[i]-'0'))) j++; count2[t]=i+j+1; count1[t]=j+1; max=count1[m...