1. Water Flow Problem Statement You are given a matrix 'A' of size 'N' x 'M', where each cell contains the height of water placed in that cell. Water can flow in four directions: up, down, left, and right, but only to cells with heights less than or equal to the current cell's height. The left and top boundaries of the matrix represent the Pacific Ocean, while the right and bottom boundaries represent the Atlantic Ocean. Your task is to determine all coordinates from which water can flow to both the Pacific and Atlantic Oceans. The output should list these coordinates sorted in lexicographical order. Input: The first line of input contains an integer 'T', representing the number of test cases. For each test case, the first line contains two space-separated positive integers 'N' and 'M'. The following 'N' lines each contain 'M' space-separated integers representing the heights in matrix 'A'. Output: For each test case, output should begin with a positive integer 'K', denoting the number of coordinates. The following 'K' lines should each contain one coordinate. Example: Input:13 31 2 23 2 32 4 5Output:40 10 21 01 1 Constraints: 1 <= T <= 50 1 <= N <= 104 1 <= M <= 104 1 <= N*M <= 104 1 <= A[i][j] <= 109 Time Limit: 1 sec Note: You do not have to print anything; implement the function as directed.
2. The Skyline Problem Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette when viewed from a distance. Each building is described by its geometric information in the form of an array BUILDINGS[i] = [LEFT_i, RIGHT_i, HEIGHT_i]. Explanation: LEFT_i: x-coordinate of the left edge of the i-th building. RIGHT_i: x-coordinate of the right edge of the i-th building. HEIGHT_i: height of the i-th building. It is assumed that all buildings are perfect rectangles grounded at height 0. The skyline must be represented as a list of "key points" sorted by x-coordinate in the format [[x1, y1], [x2, y2], ...]. Each key point marks the left endpoint of a horizontal segment in the skyline, except for the last point, which always has y-coordinate 0 to indicate the skyline's termination. Input: The first line contains an integer N indicating the number of buildings.Each of the following N lines contains three space-separated integers LEFT_i, RIGHT_i, and HEIGHT_i for each building. Output: Return a list of key points representing the skyline.The format is [[x1, y1], [x2, y2], ...], with each point marking a key horizontal segment. Example: Input:N = 2BUILDINGS = [[2, 9, 10], [3, 7, 15]]Output:[[2, 10], [3, 15], [7, 10], [9, 0]] Constraints: 1 <= |BUILDINGS| <= 10^4 0 <= LEFT_i < RIGHT_i <= 2^31 - 1 1 <= HEIGHT_i <= 2^31 - 1 Time Limit: 1 sec Note: Ensure no consecutive horizontal segments of equal height in the output. If any, merge them into one.
3. What is the ITIL process?
Browse through a variety of job opportunities tailored to your skills and preferences. Filter by location, experience, salary, and more to find your perfect fit.
We have sent an OTP to your contact. Please enter it below to verify.