Array Wrapper - Leetcode 2695 - JavaScript 30-Day Challenge

preview_player
Показать описание
Solving Day 28 of the Leetcode 30-day javascript challenge. Today we implement an array wrapper, but more specifically we overload some operators / functions of our class.

0:00 - Read the problem
0:40 - Read examples
2:00 - Coding Solution

leetcode 2695

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

Thanks! But it's a mistake in reduce function: the first argument in callback - is the accumulator and the second one - is the current item.

const sum = array.reduce(
(accumulator, currentValue) => accumulator + currentValue,
0
);

MikhailEshchenko
Автор

Love the videos keep it up :)
I have been doing leet code for a while now like 2 months and without your explanation I would be behind in progress from where I am now

seifeldeen
Автор

Hey, I love your video!
However, are the arguments of the reduce method callback reversed?
The first argument should be the accumulator, and the second should be the current value. 🤔

jordantseng
Автор

Day 28 of doing the 30-day challenge with neetcode! It's almost ended

vixguy
Автор

I love your explanations, can you Please solve the problem "2127. Maximum Employees to Be Invited to a Meeting" please!!!!:)

sumanshukumarshaw