ServiceNow interview question

Efficient way to solve 3sum problem