here we have to print all sub - sequences lexicographically , that ' s ▁ why ▁ we ▁ start ▁ from ▁ ' a ' to ' z ' if this character is  present in both of them then append it in data[] and same  remaining part
for ( char ch = ' a ' ; ch <= ' z ' ; ch ++ ) {