Monthly Archives: June 2016

Generate all possible combinations when two strings are merged while retaining the same character sequence

Given two strings A and B, generate all possible combinations when B is merged into A. Example: A = “hey” B: “sam” Then the combinations are: “heysam”, “hseaym”, “hesaym”, “sahemy” etc. Note that the character order remains the same for … Continue reading

Posted in Information Technology | Leave a comment

Print inorder combinations of an array

Take an array and print non over lapping in order pairs. Example: # [1,2,3,4] => input # output below is in order combination # (1234) # (1)(234) # (1)(23)(4) # (1)(2)(34) # (12)(34) # (12)(3)(4) # (123)(4) # (1)(2)(3)(4) using … Continue reading

Posted in Information Technology | Leave a comment