Menu
Question Index
...


Write a program to identify an half hour slot for multiple employees which they can use for meeting.
The time slot returned should be in first employee's time zone. If there is no common time return null.

Input (List) Output (String)
First : Mahesh EST [07:00 - 11:00, 13:00 - 15:30]
Second : Srinath GMT [07:00 - 11:00, 13:00 - 15:30]
Third : Narayana CST [07:00 - 11:00, 13:00 - 15:30]
08:00 - 08:30
First : Sona JST [06:00 - 08:00, 13:00 - 14:30, 16:00 - 21:30]
Second : Mona GMT [08:00 - 13:30, 13:00 - 14:00, 18:00 - 19:00]
Third : Mounika EAT [06:30 - 07:30, 13:00 - 14:00, 18:00 - 19:00]
Fourth : Sanjana IST [03:30 - 05:30, 16:00 - 21:30]
16:00 - 16:30
First : Ram SGT [05:00 - 07:00, 13:00 - 18:30]
Second : Krishna EDT [07:00 - 07:30, 13:00 - 14:00, 18:00 - 19:00]
13:00 - 13:30
First : Raju EAT [06:00 - 08:00, 16:00 - 19:30]
Second : Rani SGT [07:00 - 07:30, 16:00 - 23:00]
Third : Sneha IST [15:00 - 19:30]
Fourth : Latha GMT[12:00 - 13:30, 20:00 - 22:30]
null
First : Amulya EDT [07:00 - 07:30, 13:00 - 14:00, 19:00 - 20:00]
Second : Arun SGT [17:00 - 19:00]
Third : Anusha EAT [07:00 - 07:30, 13:00 - 14:00]
null

class CommonHalfHourSlotForMultipleEmployees

{    public static void main(String s[])
    {
        Employee mahesh = new Employee("Mahesh", "EST");
        mahesh.freeTimes.add("07:00 - 11:00");
        mahesh.freeTimes.add("13:00 - 15:30");
        Employee srinath = new Employee("Srinath", "GMT");
        srinath.freeTimes.add("07:00 - 11:00");
        srinath.freeTimes.add("13:00 - 15:30");
        Employee narayana = new Employee("Narayana", "CST");
        narayana.freeTimes.add("07:00 - 11:00");
        narayana.freeTimes.add("13:00 - 15:30");
        ArrayList employee = new ArrayList();
        employee.add(mahesh);
        employee.add(srinath);
        employee.add(narayana);
        System.out.println("The common half hour slot for all employees is : " + findFirstMeetingTime(employee));

    }


public static String findFirstMeetingTime(List<Employee> employees) {
String result = null;
//Write code here to identify an half hour slot for multiple employees which they can use for meeting.
return result;
}

//If required write any additional methods here.
}
}
class Employee {

String name;
String timeZone;
ArrayList<String> freeTimes = new ArrayList<String>();

public Employee(String name, String timeZone) {
this.name = name;
this.timeZone = timeZone;
}
}

Doubts

Problems

Topic: Locale Class In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App