NPTEL Week 8: Programming, Data Structures & Algorithms in Python -Assignment8 Solutions#nptel2025
In this video, I provide a detailed solution for Week 8 of the NPTEL "Programming, Data Structures & Algorithms in Python" course. The assignment titled "Here There Be Dragons" is a challenging grid-based pathfinding problem using Dynamic Programming (DP). 💡 Problem Overview: https://github.com/Nalajala4457/NPTEL-Programming-Data-Structures-And-Algorithms-Using-Python-week4/blob/main/week8 The kingdom is under attack by D dragons. You, a warrior, must slay K dragons in the shortest path possible. The kingdom is structured as an R × C grid, and you can only move downward, left, or right. Each row contains at most one dragon, and dragons are not at (0,0). Your goal is to compute the minimum steps required to kill K dragons. 🔹 Approach & Solution: ✔ Sorting the dragon positions by row number. ✔ Using Dynamic Programming (DP) to track the minimum distance. ✔ Implementing an efficient algorithm to solve large test cases (R, C ≤ 100000). 📜 Sample Input & Output: Input: 5 5 2 3 1 4 4 4 2 3 Output: 7 🚀 Topics Covered: ✅ Dynamic Programming Approach ✅ Grid-Based Pathfinding ✅ Sorting & Optimized Traversal ✅ Python Implementation 📢 Make sure to like, share, and subscribe for more coding tutorials! 🔔 Subscribe to WebTech Narendra for weekly coding solutions! NPTEL, NPTEL Python, NPTEL Assignment, NPTEL 2025, NPTEL Week 8, Python Programming, Dynamic Programming, Grid Pathfinding, Shortest Path, Here There Be Dragons, NPTEL Python Solutions, Programming Data Structures and Algorithms, Python Coding, Python DSA, Python Algorithms, NPTEL Coding Assignment, Python Grid Problems, WebTech Narendra, Python DP Problems, Python Course, Python Tutorial, NPTEL Programming #NPTEL #NPTEL2025 #Python #PythonProgramming #DynamicProgramming #Coding #PythonCoding #NPTELAssignment #WebTechNarendra #PythonAlgorithms #CodingTutorial #PythonDSA #DSA #PythonCourse #NPTELPython #CodingChallenge
Download
0 formatsNo download links available.