Muhammad Maaz retweeted
Give your honest answer:
How do you manage staying active on @X while also learning, building, and leveling up your skills? ๐ค
Give your honest answer:
How do you manage staying active on @X while also learning, building, and leveling up your skills? ๐ค
Muhammad Maaz retweeted
๐๐น๐ฝ๐ต๐ฎ-๐๐ฒ๐๐ฎ ๐ฃ๐ฟ๐๐ป๐ถ๐ป๐ด โ ๐ ๐ถ๐ป๐ถ๐บ๐ฎ๐
, ๐ฏ๐๐ ๐ฆ๐บ๐ฎ๐ฟ๐๐ฒ๐ฟ ๐ง
Minimax explores possible future moves to find the best decision.
The problem?
โ ๏ธ Game trees get huge.
โ ๐๐น๐ฝ๐ต๐ฎ-๐๐ฒ๐๐ฎ ๐ฃ๐ฟ๐๐ป๐ถ๐ป๐ด
โณ It skips branches that cannot possibly change the final decision.
โ ฮฑ (alpha) โ best value MAX can already guarantee.
โ ฮฒ (beta) โ best value MIN can already guarantee.
โข When ฮฑ โฅ ฮฒ, stop exploring that branch.
That's the pruning.
โ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ฒ๐
๐ฎ๐บ๐ฝ๐น๐ฒ
โณ Suppose MAX is already found:
Left branch โ 3
So:
โ ฮฑ = 3
Now MIN explores another branch:
โ Right branch โ 2
MIN can only make this branch 2 or worse.
โ MAX already has 3.
So why explore the remaining moves?
โณ Prune. โ๏ธ
โ ๐ง๐ต๐ฒ ๐ถ๐บ๐ฝ๐ผ๐ฟ๐๐ฎ๐ป๐ ๐ฝ๐ฎ๐ฟ๐
Alpha-beta pruning gives the same answer as minimax.
It simply avoids computations that don't matter.
โค Better move ordering โ more pruning.
โค Worst case โ still exponential.
โ
Minimax: Explore the possibilities.
โ
Alpha-Beta: Explore only the possibilities that matter.
โ Would you be able to identify where pruning occurs in a game tree?
๐๐น๐ฝ๐ต๐ฎ-๐๐ฒ๐๐ฎ ๐ฃ๐ฟ๐๐ป๐ถ๐ป๐ด โ ๐ ๐ถ๐ป๐ถ๐บ๐ฎ๐
, ๐ฏ๐๐ ๐ฆ๐บ๐ฎ๐ฟ๐๐ฒ๐ฟ ๐ง
Minimax explores possible future moves to find the best decision.
The problem?
โ ๏ธ Game trees get huge.
โ ๐๐น๐ฝ๐ต๐ฎ-๐๐ฒ๐๐ฎ ๐ฃ๐ฟ๐๐ป๐ถ๐ป๐ด
โณ It skips branches that cannot possibly change the final decision.
โ ฮฑ (alpha) โ best value MAX can already guarantee.
โ ฮฒ (beta) โ best value MIN can already guarantee.
โข When ฮฑ โฅ ฮฒ, stop exploring that branch.
That's the pruning.
โ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ฒ๐
๐ฎ๐บ๐ฝ๐น๐ฒ
โณ Suppose MAX is already found:
Left branch โ 3
So:
โ ฮฑ = 3
Now MIN explores another branch:
โ Right branch โ 2
MIN can only make this branch 2 or worse.
โ MAX already has 3.
So why explore the remaining moves?
โณ Prune. โ๏ธ
โ ๐ง๐ต๐ฒ ๐ถ๐บ๐ฝ๐ผ๐ฟ๐๐ฎ๐ป๐ ๐ฝ๐ฎ๐ฟ๐
Alpha-beta pruning gives the same answer as minimax.
It simply avoids computations that don't matter.
โค Better move ordering โ more pruning.
โค Worst case โ still exponential.
โ
Minimax: Explore the possibilities.
โ
Alpha-Beta: Explore only the possibilities that matter.
โ Would you be able to identify where pruning occurs in a game tree?
Muhammad Maaz retweeted
๐ง๐๐ผ ๐ฃ๐ผ๐ถ๐ป๐๐ฒ๐ฟ๐ ๐ ๐ฎ๐ฑ๐ฒ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ถ๐ป ๐ฆ๐ฒ๐ฐ๐ผ๐ป๐ฑ๐ ๐
โณ Two Pointers is one of the most useful DSA patterns for efficiently solving array and string problems.
โณ Instead of checking every possible combination, you use two pointers that move through the data intelligently.
โ ๐๐ผ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ๐
โ One pointer starts from the left.
โ The other starts from the right.
โข Both pointers move based on the current values.
โ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ฒ๐
๐ฎ๐บ๐ฝ๐น๐ฒ
Find two numbers that add up to 10:
Sorted array โ [1, 3, 5, 7, 9]
โ Left = 1
โ Right = 9
1 + 9 = 10 โ
Found it immediately.
โข If the sum is too small โ move the left pointer forward.
โข If the sum is too large โ move the right pointer backward.
โข Keep moving until the pointers meet.
โ This works because the array is sorted โ that's what tells you which direction to move. Unsorted array = no shortcut.
โ ๐ช๐ต๐ ๐ถ๐ ๐บ๐ฎ๐๐๐ฒ๐ฟ๐
โณ A brute-force solution may check every possible pair.
Two Pointers can often reduce the problem to O(n) time.
โ
๐ง๐ต๐ฒ ๐บ๐ฒ๐ป๐๐ฎ๐น ๐บ๐ผ๐ฑ๐ฒ๐น
โณ Two pointers + smart movement = fewer unnecessary comparisons.
โณ This post covers the opposite-ends variant โ pointers starting apart and moving toward each other.
Once you recognize the pattern, many array and string problems become much easier.
โโ
What DSA pattern should I explain next? ๐ค
โโ
๐ Save for later.
๐ค Follow me @1devmaaz, for more!
๐ง๐๐ผ ๐ฃ๐ผ๐ถ๐ป๐๐ฒ๐ฟ๐ ๐ ๐ฎ๐ฑ๐ฒ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ถ๐ป ๐ฆ๐ฒ๐ฐ๐ผ๐ป๐ฑ๐ ๐
โณ Two Pointers is one of the most useful DSA patterns for efficiently solving array and string problems.
โณ Instead of checking every possible combination, you use two pointers that move through the data intelligently.
โ ๐๐ผ๐ ๐ถ๐ ๐๐ผ๐ฟ๐ธ๐
โ One pointer starts from the left.
โ The other starts from the right.
โข Both pointers move based on the current values.
โ ๐ฆ๐ถ๐บ๐ฝ๐น๐ฒ ๐ฒ๐
๐ฎ๐บ๐ฝ๐น๐ฒ
Find two numbers that add up to 10:
Sorted array โ [1, 3, 5, 7, 9]
โ Left = 1
โ Right = 9
1 + 9 = 10 โ
Found it immediately.
โข If the sum is too small โ move the left pointer forward.
โข If the sum is too large โ move the right pointer backward.
โข Keep moving until the pointers meet.
โ This works because the array is sorted โ that's what tells you which direction to move. Unsorted array = no shortcut.
โ ๐ช๐ต๐ ๐ถ๐ ๐บ๐ฎ๐๐๐ฒ๐ฟ๐
โณ A brute-force solution may check every possible pair.
Two Pointers can often reduce the problem to O(n) time.
โ
๐ง๐ต๐ฒ ๐บ๐ฒ๐ป๐๐ฎ๐น ๐บ๐ผ๐ฑ๐ฒ๐น
โณ Two pointers + smart movement = fewer unnecessary comparisons.
โณ This post covers the opposite-ends variant โ pointers starting apart and moving toward each other.
Once you recognize the pattern, many array and string problems become much easier.
โโ
What DSA pattern should I explain next? ๐ค
โโ
๐ Save for later.
๐ค Follow me @1devmaaz, for more!
Muhammad Maaz retweeted
Quick question for tech Twitter/X ๐
What do you prefer reading?
โณ ๐งต Short, structured threads
โณ ๐ Longer, detailed posts
Iโm trying to figure out what format is better for sharing what Iโm learning, building, and researching.
What works better for you? ๐
Quick question for tech Twitter/X ๐
What do you prefer reading?
โณ ๐งต Short, structured threads
โณ ๐ Longer, detailed posts
Iโm trying to figure out what format is better for sharing what Iโm learning, building, and researching.
What works better for you? ๐
19/
The key idea is simple:
AI search isn't about magically finding the answer. It's about exploring possibilities intelligently until it finds a path to the goal.
Once you understand states, actions, transitions, and the frontier, algorithms like BFS, DFS, and A* stop feeling like complicated algorithmsโand start feeling like different strategies for solving the same problem.
The real question isn't โCan we find a path?โ
It's:
โWhich path should we explore first?โ ๐ง






