Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Welcome to Online IDE!! Happy Coding :) ***PERMUTATIONS*** P(n,r) = n! / (n−r)! P(3,3) = 0! / (3-3)! 6 String (s) to search in: abcbcacab String (p) template word: abc *************INITIAL VALUE OF CYCLES: 0 random num: 2 random num: 1 random num: 0 random num: 0 random num: 2 random num: 1 random num: 0 random num: 1 random num: 2 random num: 0 random num: 1 random num: 2 random num: 1 random num: 0 random num: 2 random num: 1 random num: 2 random num: 0 random num: 0 random num: 2 random num: 1 random num: 2 random num: 0 random num: 1 ******************Contents of the backup set ******************Contents of the valuesSet Subset 1: acb Subset 2: bca Subset 3: cba Subset 4: abc Subset 5: bac Subset 6: cab *************NEW VALUE CYCLES: 8 *************RUNNING TOTAL CYCLES: 8 ***PROCESSING SET AT INDEX: 0 **ENDING AT INDEX:***** 6 acb Subset: 1 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 0(a) SUBSTRING EXAMINED: abc char found: a at index: 0 a has been removed from StringBuilder (String p)= acb This is current StringBuilder (String p): cb This is STARTPOS: 0 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: cb Checking character: c against the main String index: 1(b) SUBSTRING EXAMINED: abc NO MATCH FOUND StringBuilder being emptied: cb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 1(b) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: acb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 2(c) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: acb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 3(b) SUBSTRING EXAMINED: bca NO MATCH FOUND StringBuilder being emptied: acb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 4(c) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: acb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 5(a) SUBSTRING EXAMINED: aca char found: a at index: 5 a has been removed from StringBuilder (String p)= acb This is current StringBuilder (String p): cb This is STARTPOS: 5 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: cb Checking character: c against the main String index: 6(c) SUBSTRING EXAMINED: aca char found: c at index: 6 c has been removed from StringBuilder (String p)= cb This is current StringBuilder (String p): b This is STARTPOS: 5 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: b Checking character: b against the main String index: 7(a) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: b *****RESTORING BACKUP OF STRINGBUILDER (String p): acb This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: acb Checking character: a against the main String index: 6(c) SUBSTRING EXAMINED: cab NO MATCH FOUND StringBuilder being emptied: acb *****RESTORING BACKUP OF STRINGBUILDER (String p): acb bca Subset: 2 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 0(a) SUBSTRING EXAMINED: abc NO MATCH FOUND StringBuilder being emptied: bca *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 1(b) SUBSTRING EXAMINED: bcb char found: b at index: 1 b has been removed from StringBuilder (String p)= bca This is current StringBuilder (String p): ca This is STARTPOS: 1 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ca Checking character: c against the main String index: 2(c) SUBSTRING EXAMINED: bcb char found: c at index: 2 c has been removed from StringBuilder (String p)= ca This is current StringBuilder (String p): a This is STARTPOS: 1 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: a Checking character: a against the main String index: 3(b) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: a *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 2(c) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: bca *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 3(b) SUBSTRING EXAMINED: bca char found: b at index: 3 b has been removed from StringBuilder (String p)= bca This is current StringBuilder (String p): ca This is STARTPOS: 3 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ca Checking character: c against the main String index: 4(c) SUBSTRING EXAMINED: bca char found: c at index: 4 c has been removed from StringBuilder (String p)= ca This is current StringBuilder (String p): a This is STARTPOS: 3 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: a Checking character: a against the main String index: 5(a) SUBSTRING EXAMINED: bca char found: a at index: 5 a has been removed from StringBuilder (String p)= a This is current StringBuilder (String p): ********************************************************** bca is an anagram of: bca Index(3) ********************************************************** *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 4(c) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: bca *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 5(a) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: bca *****RESTORING BACKUP OF STRINGBUILDER (String p): bca This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bca Checking character: b against the main String index: 6(c) SUBSTRING EXAMINED: cab NO MATCH FOUND StringBuilder being emptied: bca *****RESTORING BACKUP OF STRINGBUILDER (String p): bca cba Subset: 3 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 0(a) SUBSTRING EXAMINED: abc NO MATCH FOUND StringBuilder being emptied: cba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 1(b) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: cba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 2(c) SUBSTRING EXAMINED: cbc char found: c at index: 2 c has been removed from StringBuilder (String p)= cba This is current StringBuilder (String p): ba This is STARTPOS: 2 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ba Checking character: b against the main String index: 3(b) SUBSTRING EXAMINED: cbc char found: b at index: 3 b has been removed from StringBuilder (String p)= ba This is current StringBuilder (String p): a This is STARTPOS: 2 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: a Checking character: a against the main String index: 4(c) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: a *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 3(b) SUBSTRING EXAMINED: bca NO MATCH FOUND StringBuilder being emptied: cba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 4(c) SUBSTRING EXAMINED: cac char found: c at index: 4 c has been removed from StringBuilder (String p)= cba This is current StringBuilder (String p): ba This is STARTPOS: 4 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ba Checking character: b against the main String index: 5(a) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: ba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 5(a) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: cba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cba Checking character: c against the main String index: 6(c) SUBSTRING EXAMINED: cab char found: c at index: 6 c has been removed from StringBuilder (String p)= cba This is current StringBuilder (String p): ba This is STARTPOS: 6 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ba Checking character: b against the main String index: 7(a) SUBSTRING EXAMINED: cab NO MATCH FOUND StringBuilder being emptied: ba *****RESTORING BACKUP OF STRINGBUILDER (String p): cba abc Subset: 4 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 0(a) SUBSTRING EXAMINED: abc char found: a at index: 0 a has been removed from StringBuilder (String p)= abc This is current StringBuilder (String p): bc This is STARTPOS: 0 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: bc Checking character: b against the main String index: 1(b) SUBSTRING EXAMINED: abc char found: b at index: 1 b has been removed from StringBuilder (String p)= bc This is current StringBuilder (String p): c This is STARTPOS: 0 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: c Checking character: c against the main String index: 2(c) SUBSTRING EXAMINED: abc char found: c at index: 2 c has been removed from StringBuilder (String p)= c This is current StringBuilder (String p): ********************************************************** abc is an anagram of: abc Index(0) ********************************************************** *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 1(b) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: abc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 2(c) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: abc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 3(b) SUBSTRING EXAMINED: bca NO MATCH FOUND StringBuilder being emptied: abc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 4(c) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: abc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 5(a) SUBSTRING EXAMINED: aca char found: a at index: 5 a has been removed from StringBuilder (String p)= abc This is current StringBuilder (String p): bc This is STARTPOS: 5 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: bc Checking character: b against the main String index: 6(c) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: bc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: abc Checking character: a against the main String index: 6(c) SUBSTRING EXAMINED: cab NO MATCH FOUND StringBuilder being emptied: abc *****RESTORING BACKUP OF STRINGBUILDER (String p): abc bac Subset: 5 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 0(a) SUBSTRING EXAMINED: abc NO MATCH FOUND StringBuilder being emptied: bac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 1(b) SUBSTRING EXAMINED: bcb char found: b at index: 1 b has been removed from StringBuilder (String p)= bac This is current StringBuilder (String p): ac This is STARTPOS: 1 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ac Checking character: a against the main String index: 2(c) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: ac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 2(c) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: bac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 3(b) SUBSTRING EXAMINED: bca char found: b at index: 3 b has been removed from StringBuilder (String p)= bac This is current StringBuilder (String p): ac This is STARTPOS: 3 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ac Checking character: a against the main String index: 4(c) SUBSTRING EXAMINED: bca NO MATCH FOUND StringBuilder being emptied: ac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 4(c) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: bac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 5(a) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: bac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: bac Checking character: b against the main String index: 6(c) SUBSTRING EXAMINED: cab NO MATCH FOUND StringBuilder being emptied: bac *****RESTORING BACKUP OF STRINGBUILDER (String p): bac cab Subset: 6 at cycle number: 8 This is STARTPOS: 0 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 0(a) SUBSTRING EXAMINED: abc NO MATCH FOUND StringBuilder being emptied: cab *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 1 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 1(b) SUBSTRING EXAMINED: bcb NO MATCH FOUND StringBuilder being emptied: cab *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 2 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 2(c) SUBSTRING EXAMINED: cbc char found: c at index: 2 c has been removed from StringBuilder (String p)= cab This is current StringBuilder (String p): ab This is STARTPOS: 2 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ab Checking character: a against the main String index: 3(b) SUBSTRING EXAMINED: cbc NO MATCH FOUND StringBuilder being emptied: ab *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 3 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 3(b) SUBSTRING EXAMINED: bca NO MATCH FOUND StringBuilder being emptied: cab *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 4 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 4(c) SUBSTRING EXAMINED: cac char found: c at index: 4 c has been removed from StringBuilder (String p)= cab This is current StringBuilder (String p): ab This is STARTPOS: 4 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ab Checking character: a against the main String index: 5(a) SUBSTRING EXAMINED: cac char found: a at index: 5 a has been removed from StringBuilder (String p)= ab This is current StringBuilder (String p): b This is STARTPOS: 4 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: b Checking character: b against the main String index: 6(c) SUBSTRING EXAMINED: cac NO MATCH FOUND StringBuilder being emptied: b *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 5 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 5(a) SUBSTRING EXAMINED: aca NO MATCH FOUND StringBuilder being emptied: cab *****RESTORING BACKUP OF STRINGBUILDER (String p): cab This is STARTPOS: 6 This is sb length: 3 This is s length: 9 value of pos: 0 value of sb: cab Checking character: c against the main String index: 6(c) SUBSTRING EXAMINED: cab char found: c at index: 6 c has been removed from StringBuilder (String p)= cab This is current StringBuilder (String p): ab This is STARTPOS: 6 This is sb length: 2 This is s length: 9 value of pos: 0 value of sb: ab Checking character: a against the main String index: 7(a) SUBSTRING EXAMINED: cab char found: a at index: 7 a has been removed from StringBuilder (String p)= ab This is current StringBuilder (String p): b This is STARTPOS: 6 This is sb length: 1 This is s length: 9 value of pos: 0 value of sb: b Checking character: b against the main String index: 8(b) SUBSTRING EXAMINED: cab char found: b at index: 8 b has been removed from StringBuilder (String p)= b This is current StringBuilder (String p): ********************************************************** cab is an anagram of: cab Index(6) ********************************************************** *****RESTORING BACKUP OF STRINGBUILDER (String p): cab ** Process exited - Return Code: 0 **