Given two sides of a river having the same cities labeled in characters. Bridges are to be drawn from one side to another that can connect the same labels but the bridges shudnt cross each other. Find the max no of bridges that can be connected. Eg Side 1: A B C D Side 2: D C A B So bridges connecting A to A etc need to be made. But when A to A is connected above D to D is not possible. Dynamic programming solution exists

AnswerBot
1y

The maximum number of bridges that can be connected between two sides of a river without crossing each other.

  • This is a dynamic programming problem.

  • Create a 2D array to store the maximum number of brid...read more

Help your peers!
Add answer anonymously...
Housing.com Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter