Back to Type Challenges

README

questions/08804-hard-two-sum/README.md

latest1.5 KB
Original Source
<!--info-header-start--><h1>Two Sum </h1><blockquote><p>by PsiloLau <a href="https://github.com/Psilocine" target="_blank">@Psilocine</a></p></blockquote><p><a href="https://tsch.js.org/8804/play" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.zh-CN.md" target="_blank"></a> </p><!--info-header-end-->

Given an array of integers nums and an integer target, return true if two numbers such that they add up to target.

For example

ts
type sum1 = TwoSum<[3, 2, 4], 6> // true
type sum2 = TwoSum<[2, 7, 11, 15], 15> // false
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/8804/answer" target="_blank"></a> <a href="https://tsch.js.org/8804/solutions" target="_blank"></a> <!--info-footer-end-->