employer cover photo
employer logo
employer logo

JiBe Development Services

Engaged employer

JiBe Development Services interview question

Given the following Java class public class Solution { public static void main(String[args) throws IOExceptoin { var br = new BufferReader(new InputStreamReader(System.in)); var bw = new BufferWritter(new FileWriter(System.getenv("OUTPUT_PATH"))); var firstDayCount = Integer.parseInt(br.readLine().trim()); var firstDay = IntStream.range(0, firstDayCount).mapToObj(i - > { try { return br.readLine().replaceAll("\\s+$", ""); } catch (IOException e) { throw new RuntimeException(e); } }).map(String::trim).map(Integer::parseInt).collect(toList()); var lastDayCount = Integer.parseInt(br.readLine().trim()); var lastDay = IntStream.range(0, lastDayCount).mapToObj(i - > { try { return br.readLine().replaceAll("\\s+$", ""); } catche(IOException e) { throw new RuntimeException(e); } }).map(String::trim).map(Integer::parseInt).collect(toList()); var results = Results.countMettings(firstDay, lastDay); bw.write(String.valueOf(results)); bw.newLine(); br.close(); bw.close(); } } implement the method countMettings of class Results. class Results public static int countMeetings(List < Integer > firstDay, List < Integer > lastDay) {} where a start-up owner is looking to meet new investors to get some funds for the company. Each investor has a tight schedule that the owner has to respect. Given the schedules of the days investors are available, determine how many meetings the owner can schedule. Note that the owner can only have one meeting per day. The schedule consists of two integer arrays: firstDay and lastDay, aligned by index. Each element in the array firstDay represents the first day an investor is available, and each element in lastDay represents the last day an investor is available, both inclusive. Complete the function countMeetings.