Следующая задача: https://leetcode.com/problems/reverse-words-in-a-string-iii/. Она будет разобрана в 17.02.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=c4Y2vayEvpw
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=c4Y2vayEvpw
LeetCode
Reverse Words in a String III - LeetCode
Can you solve this real interview question? Reverse Words in a String III - Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
Example 1:
Input: s = "Let's take…
Example 1:
Input: s = "Let's take…
Следующая задача: https://leetcode.com/problems/search-in-a-binary-search-tree/. Она будет разобрана в 21.02.2020 в 21:00 MSK
Теги предыдущей задачи: обработка строк,O(|s|) по времени,O(1) по памяти,utf-8
Разбор предыдущей задачи: https://www.youtube.com/watch?v=1IYt44WYzkM
Теги предыдущей задачи: обработка строк,O(|s|) по времени,O(1) по памяти,utf-8
Разбор предыдущей задачи: https://www.youtube.com/watch?v=1IYt44WYzkM
LeetCode
Search in a Binary Search Tree - LeetCode
Can you solve this real interview question? Search in a Binary Search Tree - You are given the root of a binary search tree (BST) and an integer val.
Find the node in the BST that the node's value equals val and return the subtree rooted with that node.…
Find the node in the BST that the node's value equals val and return the subtree rooted with that node.…
Следующая задача: https://leetcode.com/problems/merge-two-binary-trees/. Она будет разобрана в 25.02.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(height) по времени,O(1) по памяти,нерекурсивная реализация,рекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=g38t_KAGTNs
Теги предыдущей задачи: деревья,O(height) по времени,O(1) по памяти,нерекурсивная реализация,рекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=g38t_KAGTNs
LeetCode
Merge Two Binary Trees - LeetCode
Can you solve this real interview question? Merge Two Binary Trees - You are given two binary trees root1 and root2.
Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to…
Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to…
Следующая задача: https://leetcode.com/problems/range-sum-of-bst/. Она будет разобрана в 29.02.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(min(count(t1),count(t2))) по времени,O(min(height(t1),height(t2))) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=rl4wCL07VRs
Теги предыдущей задачи: деревья,O(min(count(t1),count(t2))) по времени,O(min(height(t1),height(t2))) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=rl4wCL07VRs
LeetCode
Range Sum of BST - LeetCode
Can you solve this real interview question? Range Sum of BST - Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].
Example 1:
[https://asse…
Example 1:
[https://asse…
Следующая задача: https://leetcode.com/problems/trim-a-binary-search-tree/. Она будет разобрана в 02.03.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по памяти,оптимизация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=MLza2syA_lE
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по памяти,оптимизация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=MLza2syA_lE
LeetCode
Trim a Binary Search Tree - LeetCode
Can you solve this real interview question? Trim a Binary Search Tree - Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not…
Следующая задача: https://leetcode.com/problems/hamming-distance/. Она будет разобрана в 04.03.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(height) по времени,O(1) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=fbirDwtFsg8
Теги предыдущей задачи: деревья,O(height) по времени,O(1) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=fbirDwtFsg8
LeetCode
Hamming Distance - LeetCode
Can you solve this real interview question? Hamming Distance - The Hamming distance [https://en.wikipedia.org/wiki/Hamming_distance] between two integers is the number of positions at which the corresponding bits are different.
Given two integers x and y…
Given two integers x and y…
Следующая задача: https://leetcode.com/problems/counting-bits/. Она будет разобрана в 10.03.2020 в 21:00 MSK
Теги предыдущей задачи: битовые операции,xor,leetcode 191,O(1) по времени,O(1) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=11b_SJSX2sM
Теги предыдущей задачи: битовые операции,xor,leetcode 191,O(1) по времени,O(1) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=11b_SJSX2sM
LeetCode
Counting Bits - LeetCode
Can you solve this real interview question? Counting Bits - Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
Do not solve it with built-in functions…
Do not solve it with built-in functions…
Доброе утро! С вами Фёдор Меньшиков, и я провожу эксперимент. Я набираю группу из 5 человек для прокачки навыков решения задач интервью с leetcode. В комплекте: взаимные ревью участниками группы и ревью мной. В итоге Вы получаете уверенность, что решили задачу оптимально, а также получаете опыт code review решений коллег. Поскольку группа экспериментальная, то она набирается одна, и число мест ограничено. Также могут быть ограничения по используемым языкам программирования (участники группы должны понимать решения друг друга) и по уровню участников (им должно быть интересно решать примерно одинаковый набор задач). Стоимость участия - 10 тысяч рублей в месяц. Заявки принимаются до 12 марта включительно. За подробностями обращайтесь ко мне в личные сообщения Телеграм @FyodorMenshikov или на почту mfv@mail.ru
Следующая задача: https://leetcode.com/problems/queue-reconstruction-by-height/. Она будет разобрана в 12.03.2020 в 21:00 MSK
Теги предыдущей задачи: динамическое программирование,битовые операции,leetcode 191,O(num) по времени,O(num) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=ORb5eGO1Rlg
Теги предыдущей задачи: динамическое программирование,битовые операции,leetcode 191,O(num) по времени,O(num) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=ORb5eGO1Rlg
LeetCode
Queue Reconstruction by Height - LeetCode
Can you solve this real interview question? Queue Reconstruction by Height - You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height…
Продолжается набор группы для прокачки навыков решения задач интервью с leetcode. Чтобы всем участникам группы было интересно работать в ней, возможно, будет две группы - одна для решения Easy задач (для начинающих) и одна для решения Medium (для тех, у кого основательно решены Easy задачи leetcode). Заявки по-прежнему принимаются до 12 марта включительно. Стоимость участия 10 тысяч рублей в месяц. За подробностями обращайтесь ко мне в личные сообщения Телеграм @FyodorMenshikov или на почту mfv@mail.ru
Осталось 6 часов, когда ещё можно подать заявку на участие в групповых занятиях (детали во вчерашнем посте).
Следующая задача: https://leetcode.com/problems/daily-temperatures/. Она будет разобрана в 14.03.2020 в 21:00 MSK
Теги предыдущей задачи: обработка массива,сведение к меньшей задаче,O(n^2) по времени,O(n) по памяти,O(n^1.5) по времени
Разбор предыдущей задачи: https://www.youtube.com/watch?v=Zr35SBXsGHI
Теги предыдущей задачи: обработка массива,сведение к меньшей задаче,O(n^2) по времени,O(n) по памяти,O(n^1.5) по времени
Разбор предыдущей задачи: https://www.youtube.com/watch?v=Zr35SBXsGHI
LeetCode
Daily Temperatures - LeetCode
Can you solve this real interview question? Daily Temperatures - Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer…
Следующая задача: https://leetcode.com/problems/binary-tree-inorder-traversal/. Она будет разобрана в 16.03.2020 в 21:00 MSK
Теги предыдущей задачи: обработка массива,O(N) по времени,O(N) по памяти,ближайший бОльший,leetcode 496
Разбор предыдущей задачи: https://www.youtube.com/watch?v=QVI1uANoiiY
Теги предыдущей задачи: обработка массива,O(N) по времени,O(N) по памяти,ближайший бОльший,leetcode 496
Разбор предыдущей задачи: https://www.youtube.com/watch?v=QVI1uANoiiY
LeetCode
Binary Tree Inorder Traversal - LeetCode
Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values.
Example 1:
Input: root = [1,null,2,3]
Output: [1,3,2]
Explanation:
[https://assets.lee…
Example 1:
Input: root = [1,null,2,3]
Output: [1,3,2]
Explanation:
[https://assets.lee…
Следующая задача: https://leetcode.com/problems/permutations/. Она будет разобрана в 18.03.2020 в 21:00 MSK
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по временной памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=vQGIcbNYCYc
Теги предыдущей задачи: деревья,O(n) по времени,O(height) по временной памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=vQGIcbNYCYc
LeetCode
Permutations - LeetCode
Can you solve this real interview question? Permutations - Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Example 1:
Input: nums = [1,2,3]
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3…
Example 1:
Input: nums = [1,2,3]
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3…
Следующая задача: https://leetcode.com/problems/generate-parentheses/. Она будет разобрана в 20.03.2020 в 21:00 MSK
Теги предыдущей задачи: обработка массива,O(N*N!) по времени,O(N*N!) по памяти,рекурсивная реализация,нерекурсивная реализация,next_permutation,перестановки
Разбор предыдущей задачи: https://www.youtube.com/watch?v=ECgv_d8LgJU
Теги предыдущей задачи: обработка массива,O(N*N!) по времени,O(N*N!) по памяти,рекурсивная реализация,нерекурсивная реализация,next_permutation,перестановки
Разбор предыдущей задачи: https://www.youtube.com/watch?v=ECgv_d8LgJU
LeetCode
Generate Parentheses - LeetCode
Can you solve this real interview question? Generate Parentheses - Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]…
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]…
Следующая задача: https://leetcode.com/problems/palindromic-substrings/. Она будет разобрана в 24.03.2020 в 21:00 MSK
Теги предыдущей задачи: правильная скобочная последовательность,перебор-построение,числа Каталана,O(C(n) * n) по времени,O(C(n) * n) по памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=C5YfXfGH3pc
Теги предыдущей задачи: правильная скобочная последовательность,перебор-построение,числа Каталана,O(C(n) * n) по времени,O(C(n) * n) по памяти,рекурсивная реализация,нерекурсивная реализация
Разбор предыдущей задачи: https://www.youtube.com/watch?v=C5YfXfGH3pc
LeetCode
Palindromic Substrings - LeetCode
Can you solve this real interview question? Palindromic Substrings - Given a string s, return the number of palindromic substrings in it.
A string is a palindrome when it reads the same backward as forward.
A substring is a contiguous sequence of characters…
A string is a palindrome when it reads the same backward as forward.
A substring is a contiguous sequence of characters…
Следующая задача: https://leetcode.com/problems/top-k-frequent-elements/. Она будет разобрана в 26.03.2020 в 21:00 MSK
Теги предыдущей задачи: обработка строк,O(|s|^3) по времени,динамическое программирование,O(|s|^2) по времени,O(answer) по времени,алгоритм Манакера,O(|s|) по времени,acmp 1157
Разбор предыдущей задачи: https://www.youtube.com/watch?v=xT1p97eDIRk
Теги предыдущей задачи: обработка строк,O(|s|^3) по времени,динамическое программирование,O(|s|^2) по времени,O(answer) по времени,алгоритм Манакера,O(|s|) по времени,acmp 1157
Разбор предыдущей задачи: https://www.youtube.com/watch?v=xT1p97eDIRk
LeetCode
Top K Frequent Elements - LeetCode
Can you solve this real interview question? Top K Frequent Elements - Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1…
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1…
Следующая задача: https://leetcode.com/problems/top-k-frequent-elements/. Она будет разобрана в 07.04.2020 в 21:00 MSK
Теги предыдущей задачи: обработка строк,O(|s|^3) по времени,динамическое программирование,O(|s|^2) по времени,O(answer) по времени,алгоритм Манакера,O(|s|) по времени,acmp 1157
Разбор предыдущей задачи: https://www.youtube.com/watch?v=xT1p97eDIRk
Теги предыдущей задачи: обработка строк,O(|s|^3) по времени,динамическое программирование,O(|s|^2) по времени,O(answer) по времени,алгоритм Манакера,O(|s|) по времени,acmp 1157
Разбор предыдущей задачи: https://www.youtube.com/watch?v=xT1p97eDIRk
LeetCode
Top K Frequent Elements - LeetCode
Can you solve this real interview question? Top K Frequent Elements - Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1…
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1…
Следующая задача: https://leetcode.com/problems/product-of-array-except-self/. Она будет разобрана в 09.04.2020 в 21:00 MSK
Теги предыдущей задачи: структуры данных,O(n) по времени,O(n) по памяти,unordered_map,nth_element
Разбор предыдущей задачи: https://www.youtube.com/watch?v=gamjygyIzg0
Теги предыдущей задачи: структуры данных,O(n) по времени,O(n) по памяти,unordered_map,nth_element
Разбор предыдущей задачи: https://www.youtube.com/watch?v=gamjygyIzg0
LeetCode
Product of Array Except Self - LeetCode
Can you solve this real interview question? Product of Array Except Self - Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].
The product of any prefix or suffix of…
The product of any prefix or suffix of…
Следующая задача: https://leetcode.com/problems/subsets/. Она будет разобрана в 11.04.2020 в 21:00 MSK
Теги предыдущей задачи: обработка массива,O(n) по времени,O(n) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=1CvKUvzJvhQ
Теги предыдущей задачи: обработка массива,O(n) по времени,O(n) по памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=1CvKUvzJvhQ
LeetCode
Subsets - LeetCode
Can you solve this real interview question? Subsets - Given an integer array nums of unique elements, return all possible subsets (the power set).
The solution set must not contain duplicate subsets. Return the solution in any order.
Example 1:
Input:…
The solution set must not contain duplicate subsets. Return the solution in any order.
Example 1:
Input:…
Следующая задача: https://leetcode.com/problems/group-anagrams/. Она будет разобрана в 15.04.2020 в 21:00 MSK
Теги предыдущей задачи: перебор 2^n,нерекурсивная реализация,O(len*2^len) по времени и памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=F5xQezA84p4
Теги предыдущей задачи: перебор 2^n,нерекурсивная реализация,O(len*2^len) по времени и памяти
Разбор предыдущей задачи: https://www.youtube.com/watch?v=F5xQezA84p4
LeetCode
Group Anagrams - LeetCode
Can you solve this real interview question? Group Anagrams - Given an array of strings strs, group the anagrams together. You can return the answer in any order.
Example 1:
Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat"…
Example 1:
Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat"…