LeetCode Weekly Contest 479 | All 4 Problems Solved in C++ | Full Explanation (Q1–Q4)
Автор: Yash Poonia
Загружено: 2025-12-07
Просмотров: 139
𝐈𝐧 𝐭𝐡𝐢𝐬 𝐯𝐢𝐝𝐞𝐨, 𝐈 𝐜𝐨𝐯𝐞𝐫 𝐀𝐋𝐋 𝟒 𝐩𝐫𝐨𝐛𝐥𝐞𝐦𝐬 𝐟𝐫𝐨𝐦 𝐋𝐞𝐞𝐭𝐂𝐨𝐝𝐞 𝐖𝐞𝐞𝐤𝐥𝐲 𝐂𝐨𝐧𝐭𝐞𝐬𝐭 𝟒𝟕𝟗 𝐰𝐢𝐭𝐡 𝐜𝐨𝐦𝐩𝐥𝐞𝐭𝐞 𝐬𝐭𝐞𝐩-𝐛𝐲-𝐬𝐭𝐞𝐩 𝐞𝐱𝐩𝐥𝐚𝐧𝐚𝐭𝐢𝐨𝐧𝐬 𝐢𝐧 𝐂++.
Each problem is solved with full intuition, optimized approach, and clean implementation — perfect for both beginners and competitive programmers.
🔥 𝐏𝐫𝐨𝐛𝐥𝐞𝐦𝐬 𝐂𝐨𝐯𝐞𝐫𝐞𝐝:
🔹 𝟑𝟕𝟔𝟗. 𝐒𝐨𝐫𝐭 𝐈𝐧𝐭𝐞𝐠𝐞𝐫𝐬 𝐛𝐲 𝐁𝐢𝐧𝐚𝐫𝐲 𝐑𝐞𝐟𝐥𝐞𝐜𝐭𝐢𝐨𝐧 (𝐄𝐚𝐬𝐲)
→ Bit manipulation + custom sorting
🔹 𝟑𝟕𝟕𝟎. 𝐋𝐚𝐫𝐠𝐞𝐬𝐭 𝐏𝐫𝐢𝐦𝐞 𝐟𝐫𝐨𝐦 𝐂𝐨𝐧𝐬𝐞𝐜𝐮𝐭𝐢𝐯𝐞 𝐏𝐫𝐢𝐦𝐞 𝐒𝐮𝐦 (𝐌𝐞𝐝𝐢𝐮𝐦)
→ Sieve of Eratosthenes + prefix sums
🔹 𝟑𝟕𝟕𝟏. 𝐓𝐨𝐭𝐚𝐥 𝐒𝐜𝐨𝐫𝐞 𝐨𝐟 𝐃𝐮𝐧𝐠𝐞𝐨𝐧 𝐑𝐮𝐧𝐬 (𝐌𝐞𝐝𝐢𝐮𝐦)
→ Prefix sums + Fenwick Tree + inequality optimization
🔹 𝟑𝟕𝟕𝟐. 𝐌𝐚𝐱𝐢𝐦𝐮𝐦 𝐒𝐮𝐛𝐠𝐫𝐚𝐩𝐡 𝐒𝐜𝐨𝐫𝐞 𝐢𝐧 𝐚 𝐓𝐫𝐞𝐞 (𝐇𝐚𝐫𝐝)
→ Tree DP + Rerooting Technique
Every solution includes:
• Detailed intuition
• Dry run on examples
• Edge case handling
• Time & space complexity analysis
• Optimized C++ code
This video is ideal for:
✔ LeetCode Contest Preparation
✔ Competitive Programming
✔ FAANG / MAANG Interview Prep
✔ Mastering Greedy, Sliding Window & Fenwick Tree
✔ C++ Algorithm Practice
━━━━━━━━━━━━━━━━━━━━━━━
📚 MORE LEARNING RESOURCES
━━━━━━━━━━━━━━━━━━━━━━━
🔹 Dynamic Programming Playlist (CSES + CF):
👉 • Dynamic Programming for Competitive Progra...
🔹 Bitmask DP Complete Series:
👉 • Bitmask DP Complete Series | Subset DP, TS...
🔹 DP on Trees & DAGs:
👉 • DP on Trees & DAGs | Dynamic Programming o...
🔹 Number Theory for Competitive Programming:
👉 • Number Theory for Competitive Programming ...
🔹 Greedy Algorithms Course:
👉 • Greedy Algorithms Course | Competitive Pro...
🔹 Segment Tree Playlist:
👉 • Segment Tree | Master Competitive Programm...
━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━
00:00 – Introduction
01:28 – Problem 3769 (Binary Reflection Sorting)
14:30 – Problem 3770 (Consecutive Prime Sum)
22:56 – Problem 3771 (Dungeon Runs – Prefix + Fenwick)
43:50 – Problem 3772 (Tree Subgraph Score – Hard)
━━━━━━━━━━━━━━━━━━━━━━━
💻 CODE & PRACTICE
━━━━━━━━━━━━━━━━━━━━━━━
All code is written in C++ and follows competitive programming standards with optimal time complexity.
━━━━━━━━━━━━━━━━━━━━━━━
🙏 SUPPORT THE CHANNEL
━━━━━━━━━━━━━━━━━━━━━━━
If this video helped you:
✅ Like the video
✅ Subscribe for more LeetCode & CP content
✅ Comment if you want solutions for more contests
✅ Share with your coding friends
Thanks for watching and happy coding! 🚀
💡 𝐏𝐞𝐫𝐟𝐞𝐜𝐭 𝐟𝐨𝐫:
Competitive programmers
Data structure & algorithms learners
Coding interview prep
📌 Watch this till the end to fully understand the intuition, not just the code.
👉 Whether you’re a beginner or looking to strengthen your logical thinking, this course will help you 𝐭𝐡𝐢𝐧𝐤 𝐥𝐢𝐤𝐞 𝐚 𝐜𝐨𝐦𝐩𝐞𝐭𝐢𝐭𝐢𝐯𝐞 𝐩𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐞𝐫 𝐚𝐧𝐝 𝐝𝐞𝐬𝐢𝐠𝐧 𝐜𝐨𝐧𝐬𝐭𝐫𝐮𝐜𝐭𝐢𝐯𝐞 𝐬𝐨𝐥𝐮𝐭𝐢𝐨𝐧𝐬 𝐜𝐨𝐧𝐟𝐢𝐝𝐞𝐧𝐭𝐥𝐲 𝐢𝐧 𝐜𝐨𝐧𝐭𝐞𝐬𝐭𝐬.
👋 𝐖𝐞𝐥𝐜𝐨𝐦𝐞 𝐭𝐨 𝐭𝐡𝐞 𝐜𝐡𝐚𝐧𝐧𝐞𝐥!
I create content on 𝐂𝐨𝐦𝐩𝐞𝐭𝐢𝐭𝐢𝐯𝐞 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠, 𝐃𝐚𝐭𝐚 𝐒𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞𝐬 & 𝐀𝐥𝐠𝐨𝐫𝐢𝐭𝐡𝐦𝐬 (𝐃𝐒𝐀), 𝐚𝐧𝐝 𝐓𝐞𝐜𝐡𝐧𝐢𝐜𝐚𝐥 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧.
If you find this video helpful, don’t forget to:
👍 Like the video
💬 Comment your doubts/questions (I reply to everyone!)
🔔 Subscribe and turn on notifications to never miss upcoming tutorials
📌 𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐰𝐢𝐭𝐡 𝐦𝐞:
🐦 X: https://x.com/Yash_Poonia_...
💼 LinkedIn: / ...
💻 GitHub: https://github.com/yash7xm...
🌐 Discord: / discord
#LeetCode #Weekly479 #LeetCodeContest #CompetitiveProgramming
#SlidingWindow #FenwickTree #GreedyAlgorithm #LeetCodeHard
#CodingInterview #DSA #FAANG #MAANG #CP#LeetCode #CPlusPlus
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: