Write a program which takes an existing highway network (specified as a set of highway sections between pairs of cities) and proposals for new highway sections, and returns the proposed highway section which leads to the most improvement in the total driving distance.
ReadThere are n servers in a network, connected by undirected server-to-server connections. A critical connection is a connection that, if removed, will make some server unable to reach some other server. Find all critical connections.
ReadGiven an n x m matrix of positive integers representing the height of each cell in a 2D elevation map, compute the amount of water that can be trapped within it.
ReadGiven an array of non-negative integers that represent an elevation map where the width of each bar is 1, compute the amount of rainwater that can be trapped within it.
ReadGiven an array of non-negative integers which represent histogram bar heights, find the area of largest rectangle.
ReadThere are N cities. You are given an array of connections. Each connection describes the cost of connecting one city to another. Return the minimum cost required to ensure that every pair of cities is connected by a path of connections.
ReadYou have an array for which the i-th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most k transactions.
ReadGiven an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal.
Read