Problem 259: 3Sum Smaller

https://leetcode.com/problems/3sum-smaller/#/description

思路

  • 双指针法:遍历 i 的时候, 用 left 和 right 从两边向中间逼近

  • 注意:一定要 sort 原来的 Array

Last updated

Was this helpful?