MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / book

Method book

myCalendar1.java:7–14  ·  view source on GitHub ↗
(int start, int end)

Source from the content-addressed store, hash-verified

5 }
6
7 public boolean book(int start, int end) {
8 Integer prevVal = map.lowerKey(end);
9 if(prevVal!=null && start <= map.get(prevVal)-1){
10 return false;
11 }
12 map.put(start,end);
13 return true;
14 }
15}
16
17/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected