Google Interview Question

asked arrays and graphs question