Back to Browse

1462. Course Schedule IV | leetcode daily challenge | shashcode | java | dsa | shashwat

1.6K views
Jan 27, 2025
17:14

Topo sort: https://youtu.be/tZjVTTABXV0?si=6nKTqpR30XpVIwht Floyd Warshall: https://youtu.be/7y88NO1Aq1o?si=gd0HrdU5E0BNLcw6 Problem Link: https://leetcode.com/problems/course-schedule-iv/description/?envType=daily-question&envId=2025-01-27 Problem Statement: There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi. For example, the pair [0, 1] indicates that you have to take course 0 before you can take course 1. Prerequisites can also be indirect. If course a is a prerequisite of course b, and course b is a prerequisite of course c, then course a is a prerequisite of course c. You are also given an array queries where queries[j] = [uj, vj]. For the jth query, you should answer whether course uj is a prerequisite of course vj or not. Return a boolean array answer, where answer[j] is the answer to the jth query. Solution Link: https://github.com/Tiwarishashwat/InterviewCodes/blob/main/courseSchedule4.java Custom Comparator: https://youtu.be/quegYlReztM?si=G265RK8IFpP92_4b Lambda Expression: https://youtu.be/3DkmAUdrzKw?si=q9pqrvNPKAXt1g0d Dynamic Programming: https://youtu.be/P3MFBCZCGXs?si=A832THtbhyqPNAf2 Graph Playlist: https://www.youtube.com/playlist?list=PLQ7ZAf76c0ZOGuMjg3qwNgILb_dKWTxyQ Java Plus DSA Placement Course Playlist: https://youtube.com/playlist?list=PLQ7ZAf76c0ZPVdhV1bAjFv0bQc1xHURzE Java Plus DSA Sheet: https://docs.google.com/spreadsheets/d/119u25NO-4ZJ9zwfUKs5eGNo0exCVq3gZEFWvkCDiMqI/edit?usp=sharing Notes: https://github.com/Tiwarishashwat/Java-Plus-DSA-Placement-Course Telegram Link: https://shashwattiwari.page.link/telegramShashwat Ultimate Recursion Series Playlist: https://youtube.com/playlist?list=PLQ7ZAf76c0ZMzC9OHPbo-dUgx6oU3T0jK Instagram Handle: (@shashwat_tiwari_st) https://shashwattiwari.page.link/shashwatInsta Samsung Interview Experience: https://youtu.be/GrvlpBzphSU Company Tags: Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung Timestamp: 0:00 - Introduction

Download

0 formats

No download links available.

1462. Course Schedule IV | leetcode daily challenge | shashcode | java | dsa | shashwat | NatokHD