lintcode-medium-Nuts & Bolts Problem
Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Comparison of a nut to another nut or a bolt to another bolt is not allowed. It means nut can only be compared with bolt and bolt can only be compared with nut to see which one is bigger/smaller. We will give you a compare function to compare nut with bolt. Example Given nuts = ['ab','bc','dd','gg'] , bolts = ['AB','GG', 'DD', 'BC'] . Your code should find the matching bolts and nuts. one of the possible return: nuts = ['ab','bc','dd','gg'] , bolts = ['AB','BC','DD','GG']