PDA

View Full Version : Intersection of two strings


C++
07-23-2009, 07:23 PM
Hi, Could someone tell me if there's a better way of doing this? I was asked this question in an interview and I wrote a piece of code of O(n2). ---Quote--- // This function returns a new string of the common alphabets found in a and b char* intersection(char*a, char* b) { static char...