Лучшее на RU-vid
Кино
Авто/Мото
Видеоклипы
Животные
Спорт
Игры
Приколы
Развлечения
Хобби
Наука
Авторизоваться
Зарегистрироваться
Middle of the Linked List - Leetcode 876 - Python
4:57
Spring Boot Quick Start 8 - Creating a Spring Boot project
9:53
Аруси чахондида Лахзахои Гуворро бо Гр Арабшо сахнаи нав 2024
05:05
ЗОМБИ-ГАЗОНОКОСИЛЬЩИК И ДРУГИЕ ПРИКОЛЫ ODD MOD'А
00:43
Сказала дочке НЕТ!
00:24
Mark Rober vs Dude Perfect- Ultimate Robot Battle
19:00
Range Sum Query Immutable - Leetcode 303 - Python
NeetCodeIO
Подписаться 176 тыс.
Просмотров 16 тыс.
50%
1
Видео
Поделиться
Скачать
Добавить в
Опубликовано:
8 сен 2024
Поделиться:
Ссылка:
Скачать:
Готовим ссылку...
Добавить в:
Мой плейлист
Посмотреть позже
Комментарии :
12
@CodingWithCesar
Год назад
A trick I like to use for the prefix array is to subtract left and add nums[left] instead of going one position over so we don't have to worry about boundary check, for example: prefix[right] - prefix[left] + nums[left]
@samcarter8828
Год назад
Nice trick
@gradientO
Год назад
but that requires us to store the nums array. Using prefix array, we dont need that
@tsunami8892
Год назад
also that can be - prefix[right] - (prefix[left - 1] || 0)
@ChrisCox-wv7oo
10 месяцев назад
prefix[-1] returns the last element in Python
@shavvasatya7131
Год назад
Great as usual.
@flatmapper
Год назад
2:00 Why O(n^2)? O(n^2) is the time complexity of finding pairs. Intuitively the time complexity is greater to find every subarray
@MsPokemonmaster145
Месяц назад
He is saying that the number of subarrays is O(n^2) (To be exact, n*(n-1)). You are right tho to find all sums it would take O(n^3).
@sanooosai
6 месяцев назад
thank you
@flatmapper
Год назад
Amazing!
@MianyunNi
Год назад
what if left = 0, right = 0; -2 + (-2)
@mehedihassan-pf6yh
4 месяца назад
You wrote left > 0 then but as index , left can be 0 to indicate first index
Далее
4:57
Middle of the Linked List - Leetcode 876 - Python
Просмотров 24 тыс.
9:53
Spring Boot Quick Start 8 - Creating a Spring Boot project
Просмотров 1 млн
05:05
Аруси чахондида Лахзахои Гуворро бо Гр Арабшо сахнаи нав 2024
Просмотров 179 тыс.
00:43
ЗОМБИ-ГАЗОНОКОСИЛЬЩИК И ДРУГИЕ ПРИКОЛЫ ODD MOD'А
Просмотров 674 тыс.
00:24
Сказала дочке НЕТ!
Просмотров 1,1 млн
19:00
Mark Rober vs Dude Perfect- Ultimate Robot Battle
Просмотров 4,9 млн
1:44:13
System Design of Payment Gateway
Просмотров 11 тыс.
13:17
Range Sum Query 2D - Immutable - Leetcode 304 - Python
Просмотров 38 тыс.
13:00
LeetCode was HARD until I Learned these 15 Patterns
Просмотров 261 тыс.
9:23
Maximum Distance in Arrays - Leetcode 624 - Python
Просмотров 10 тыс.
18:07
Elon's Big Bet On Tesla's Future | Optimus 2
Просмотров 89 тыс.
10:06
Leetcode 46. Permutations : Introduction to backtracking
Просмотров 94 тыс.
20:59
Integer to English Words - Leetcode 273 - Python
Просмотров 13 тыс.
26:32
Sum of given range | Segment tree construction and update | Simplest explanation
Просмотров 55 тыс.
8:36
I gave 127 interviews. Top 5 Algorithms they asked me.
Просмотров 648 тыс.
20:51
Prefix Sums - Problems, Code in C++ & Python
Просмотров 49 тыс.
05:05
Аруси чахондида Лахзахои Гуворро бо Гр Арабшо сахнаи нав 2024
Просмотров 179 тыс.