| import java.io.*;
|
| import java.util.*;
|
| import java.text.*;
|
| import java.math.*;
|
| import java.util.regex.*;
|
|
|
| public class Solution {
|
| public static void main(String args[] ) throws Exception {
|
| /* Enter your code here. Read input from STDIN. Print output to STDOUT */
|
| }
|
| public static void UnqiueRatings(List<Employee> e, int id){
|
| Set<Integer> r = new HashSet<>();
|
| boolean empfound= false;
|
| for(Employee emp: e){
|
| if(emp.empid==id){
|
| empfound=true;
|
| ArrayList<Project> pl = emp.getProjects();
|
| for(Project pro: pl){
|
| r.add(pro.getRating());
|
| }
|
|
|
| }
|
| }
|
|
|
| if(!empfound){
|
| System.out.println("No Employee Found");
|
| }
|
| else{
|
| for(Integer rat:r){
|
| System.out.println(rat);
|
| }
|
|
|
| }
|
| }
|
| }
|
| class Project{
|
| String projectname;
|
| int rating;
|
| public Project(String projectname,int rating){
|
| this.projectname=projectname;
|
| this.rating=rating;
|
| }
|
| public String getProjectname() {
|
| return projectname;
|
| }
|
| public int getRating() {
|
| return rating;
|
| }
|
| }
|
| class Employee{
|
| int empid;
|
| String empname;
|
| String compname;
|
| int projcount;
|
| ArrayList<Project> projects;
|
| public Employee(int empid,String empname,String compname,
|
| int projcount,ArrayList<Project> projects){
|
| this.empid=empid;
|
| this.empname=empname;
|
| this.compname=compname;
|
| this.projcount=projcount;
|
| this.projects= new ArrayList<>(projects);
|
| }
|
| public int getEmpid() {
|
| return empid;
|
| }public int getProjcount() {
|
| return projcount;
|
| }
|
| public String getCompname() {
|
| return compname;
|
| }
|
| public String getEmpname() {
|
| return empname;
|
| }
|
| public ArrayList<Project> getProjects() {
|
| return projects;
|
| }
|
| }
|