Showing 3 of 85 questions
Simulate a single-threaded CPU processing tasks with varying arrival times and processing durations. Determine the order in which the CPU processes the tasks to minimize idle time, and return the processing order.
#1. Single-Threaded CPU
Imagine a grid representing rooms, some empty, some with walls, and some with gates. Fill each empty room with the distance to its nearest gate.
#2. Walls and Gates
Find the longest path in a matrix where each step increases in value. You can only move up, down, left, or right.
#3. Longest Increasing Path in a Matrix