16. 3Sum Closest

第 16 題跟 15 題相似,又增加了些許難度。題目敘述一樣也很簡單 : 求 nums 內最接近 target 值的三數和。因為是求最接近 target 值的三數和,而解答也沒有要關注其 index,故還是可以考慮將 nums 排序,這樣就可以確定指針滑動方向。

Continue reading

Author's picture

李昀陽 YunYang Lee

Welcome to my Tech Note. You can read some of the chapters below.

Software Engineer

Taiwan