Building Bridges
Let's solve the Building Bridges problem using Dynamic Programming.
We'll cover the following...
Statement
Two cities are to be connected via north
and south
, consisting of positive integers.
Note:
north
represents the coordinates of bridges on the northern bank of the river, whereassouth
represents the coordinates of bridges on the southern bank.
What is the maximum number of bridges if the
For example, we have two arrays:
One possibility is that we can connect