Facebook Interview Question for Software Developers
- 0of 0 votes
There are N coins with coordinates (x, y) where x >0 and y >0- emb April 02, 2016 in United States
You start at (0, 0) and you can only do steps of form (dx, dy) where dx >0 and dy > 0
Print the maximum number of coins that you can collect.
Clarification: you can do as many moves as you wish, the point is to collect maximum number of coins. If you are located at position (a, b) you may jump to position (a+dx, b+dy) for all dx > 0 and dy > 0
@krbchd: Your algorithm may output incorrect values. Suppose there are points (5, 7), (5, 8), (5, 9) for y coordinates LIS will output 7, 8, 9, however since these points are on the same x axis, you can choose only one of them.
| Report Duplicate | Flag | PURGE
Facebook Software Developer Algorithm
Interview Type: In-Person
Open Chat in New Window