This is my way for learning algorithms on JS.
Repository with prepared empty tasks for training in Example folder with test cases.
/**
* 1. Two Sum
* https://leetcode.com/problems/two-sum/
* Difficulty: Easy
*
* Given an array of integers `nums` and an integer `target`, return indices
* of the two numbers such that they add up to `target`.
*
* You may assume that each input would have exactly one solution, and you
* may not use the same element twice.
*
* You can return the answer in any order.
*/
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function (nums, target) {
};
const example1 = twoSum([2, 7, 11, 15], 9); // [0,1]
const example2 = twoSum([3, 2, 4], 6); // [1,2]
const example3 = twoSum([3, 3], 6); // [0,1]
console.log(example1);
console.log(example2);
console.log(example3);
Test cases is groupped inderections for learning in propper order how it recommended in neetcode
example
0.ArraysHash
1.TwoPointers
...
18.MathGeometry
This repo is Copy of leetcode-javascript