Combinations - Leetcode 77 - Recursive Backtracking (Python)

  Рет қаралды 5,377

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер: 10
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@ARkhan-xw8ud
@ARkhan-xw8ud 6 ай бұрын
I did not get it
@rhen4610
@rhen4610 8 ай бұрын
my school told me it was gon be just some basic/fundamental coding problem, but then they threw this out there on the medium category of the challenge. Thanks tho!
@GregHogg
@GregHogg 8 ай бұрын
Haha I see! You're very welcome :P
@stanleyching123
@stanleyching123 5 ай бұрын
Hey Greg, really cool solutions.. but I’m struggling with visualising the recursive backtrack algorithm and the tree. I think it will be helpful if you could run the code line by line in respect with the visual diagram and shows how it work
@ThoXuanLe
@ThoXuanLe Ай бұрын
I think you also need to write on paper to understand deeper, that how I learn recursive.
@gamasterprochannel856
@gamasterprochannel856 6 ай бұрын
couldn't we start with 1 not 4 ?
@user-jm6gp2qc8x
@user-jm6gp2qc8x 4 ай бұрын
Hey Gregg, I am following your vids a lot. I feel that this solution can be modified to be a bit more intuitive for audience
@nikunjdeeep
@nikunjdeeep 4 ай бұрын
hey greg i enojoy learning from your videos but you could have solved this (1 to n) and not (n to 1) because visulizing first one for a new coder is easier i guess(atleast for me)
@bilalalfakih1017
@bilalalfakih1017 3 ай бұрын
class Solution: def combine(self, n: int, k: int) -> List[List[int]]: result, sol = [], [] def backtrack(i): if len(sol) == k: result.append(sol[:]) return for num in range(i, n + 1): sol.append(num) backtrack(num+1) sol.pop() backtrack(1) return result
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 219 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
Combinations - Leetcode 77 - Python
10:38
NeetCode
Рет қаралды 73 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 776 М.
Recursive Backtracking - DSA Course in Python Lecture 14
12:58
Word Search - Backtracking - Leetcode 79 - Python
10:18
NeetCode
Рет қаралды 351 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 237 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 340 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
N-Queens - Backtracking - Leetcode 51 - Python
17:51
NeetCode
Рет қаралды 188 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН