Muhammad Maaz (@1devmaaz) header
Muhammad Maaz (@1devmaaz) profile picture

Developer, passionate about AI and startups. Sharing my journey and more high-quality content

Portfolio
Joined April 2021
Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)Photo by Muhammad Maaz (@1devmaaz)
How did I learn computer science, and coding stuff?๐Ÿค” Mega thread๐Ÿงต
44
236
5
1,130
Muhammad Maaz retweeted
Give your honest answer: How do you manage staying active on @X while also learning, building, and leveling up your skills? ๐Ÿค”
1
1
2
91
Give your honest answer: How do you manage staying active on @X while also learning, building, and leveling up your skills? ๐Ÿค”
1
1
2
91
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?
1
4
89
๐—”๐—น๐—ฝ๐—ต๐—ฎ-๐—•๐—ฒ๐˜๐—ฎ ๐—ฃ๐—ฟ๐˜‚๐—ป๐—ถ๐—ป๐—ด โ€” ๐— ๐—ถ๐—ป๐—ถ๐—บ๐—ฎ๐˜…, ๐—ฏ๐˜‚๐˜ ๐—ฆ๐—บ๐—ฎ๐—ฟ๐˜๐—ฒ๐—ฟ ๐Ÿง  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?
1
4
89
Muhammad Maaz retweeted
๐Ÿฆ€ Rust: The language that makes memory safety feel like a superpower ๐Ÿš€
1
1
4
175
Muhammad Maaz retweeted
Just 6 more to hit 1600 followers ๐Ÿš€
1
1
2
114
๐Ÿฆ€ Rust: The language that makes memory safety feel like a superpower ๐Ÿš€
1
1
4
175
Just 6 more to hit 1600 followers ๐Ÿš€
1
1
2
114
What's the DSA pattern that took you the longest to understand? Mine was Dynamic Programming.๐Ÿ‘€
4
86
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!
2
3
5
134
๐—ง๐˜„๐—ผ ๐—ฃ๐—ผ๐—ถ๐—ป๐˜๐—ฒ๐—ฟ๐˜€ ๐— ๐—ฎ๐—ฑ๐—ฒ ๐—ฆ๐—ถ๐—บ๐—ฝ๐—น๐—ฒ ๐—ถ๐—ป ๐—ฆ๐—ฒ๐—ฐ๐—ผ๐—ป๐—ฑ๐˜€ ๐Ÿš€ โ†ณ 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!
2
3
5
134
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? ๐Ÿ‘‡
8
2
7
226
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? ๐Ÿ‘‡
8
2
7
226
Muhammad Maaz retweeted
How does an AI find its way through a maze? ๐Ÿงต
1
3
7
98
How does an AI find its way through a maze? ๐Ÿงต
1
3
7
98
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?โ€ ๐Ÿง 
1
18
If you found this useful, follow me for more simple breakdowns of - AI - software engineering - and computer science. More technical threads coming soon. ๐Ÿš€ Follow + turn on notifications ๐Ÿ””
1
13