leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

commit dec44791f7f414b37af8e0cd36f46e82c3450b52
parent 1943c2489fa9ed85dea5494cf6c517c47db5302c
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Mon,  8 May 2023 13:31:30 +0200

JavaScript Challenge: Day 4

Diffstat:
AProblems/2635.js | 10++++++++++
MREADME.md | 1+
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/Problems/2635.js b/Problems/2635.js @@ -0,0 +1,10 @@ +/** + * @param {number[]} arr + * @param {Function} fn + * @return {number[]} + */ + +var map = function(arr, fn) { + for(elem in arr) fn(elem); + return arr; +}; diff --git a/README.md b/README.md @@ -537,5 +537,6 @@ for solving problems. | 2492 | Medium | [Minimum Score of a Path Between Two Cities](Problems/2492.cpp) | | 2497 | Medium | [Maximum Star Sum of a Graph](Problems/2497.cpp) | | 2620 | Easy | [Counter](Problems/2620.js) | +| 2635 | Easy | [Apply Transform Over Each Element in Array](Problems/2635.js) | | 2665 | Easy | [Counter II](Problems/2665.js) | | 2667 | Easy | [Create Hello World Function](Problems/2667.js) |