I have this data:
There are three columns r_code, wtg_code and rr. Every row can be treated as a collection of object properties. We have to select n number of rows from the existing rows. Considering the row are sorted in decreasing order of r_code, constraints are,
- Select the rows in decreasing order of r_code, many rows can have the same r_code.
- If many rows have the same r_code, then select on the basis of decreasing wtg_code.
- If multiple rows have the same wtg_code then select on the basis of lowest rr.
If you can give the solution in Javascript then it will be better otherwise I welcome any language.