Find largest digit-sharing subset | Google Interview Question