Google Interview Question

1. 3sum, 2. permutation