Leetcode Array 1: Two Sum - Recap and Tips for Success ๐๐๐ช
const nums = [2, 7, 11, 15];
const target = 9;
const twoSum = function(nums, target) {
const hashTable = {};
//created a hashtable
for (let i = 0; i < nums.length; i++) {
if (hashTable[target - nums[i]] !== undefined) {
return...
ankushsrj.hashnode.dev2 min read