Google Telephonic Interview
Anonymous User
572

If you are given with a list of contacts with emails

class Contact{

String[] email;
}

return the contacts which are not a subset other contacts

List<Contact> removeDuplicate(List<Contact>){

// return contacts
}
input : [[a@gmail.com,b@gmail.com],
           [b@gmail.com],[c@gmail.com]]
output: [[a@gmail.com,b@gmail.com],
			[c@gmail.com]]

	input : [[a@gmail.com,b@gmail.com],
				[b@gmail.com,c@gmail.com],
				[c@gmail.com]]
output: [
				[a@gmail.com,b@gmail.com],
				[b@gmail.com,c@gmail.com]]

  input : [[a@gmail.com,b@gmail.com,c@gmail.com],   
				[b@gmail.com,c@gmail.com,d@gmail.com],
				[a@gmail.com,d@gmail.com]]


output: [[a@gmail.com,b@gmail.com,c@gmail.com],
					[b@gmail.com,c@gmail.com,d@gmail.com],
					[a@gmail.com,d@gmail.com]]]
					
					
				


Comments (2)