I dont know the approach to this problem

please tell about the steps or method to solve this problem

@jatin111,

this problem is very simple using interface
just implement the comparable interface and write the compareTo method to sort according to given condition
https://ide.codingblocks.com/s/234889 you can take help of this code and understand the approach.

You need to create a separate class for Salary inputs and define a constructor to take input and compare function to remove redundant values.

can you please give a solution which uses the concepts taught in videos before this problem

@jatin111,

This is the solution for this problem. Just write code for the comparator.

You need to create a separate class for Salary inputs and define a constructor to take input and compare function to remove redundant values.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.