Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
I did it using the sliding window technique we used previouslypublic static int ...

Angel Morales

Apr 13, 2022

I did it using the sliding window technique we used previously

public static int findMinimumMeetingRooms(int[][] meetings) { Arrays.sort(meetings, Comparator.comparingInt(a -> a[0])); System.out.println(Arrays.deepToString(meetings)); int count = 1; int result= 1; int start = 0; for (int end = 1; end < meetings.length ; end++) { if (meetings[end][0] < meetings[end-1][1]){ count++; }else{ count =1; } while(count > 2 && meetings[start][1]

0

0

Comments
Comments

On this page