Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 13335bc

Browse files
refactor 729
1 parent 66bf4b2 commit 13335bc

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-2
lines changed

src/main/java/com/fishercoder/solutions/_729.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public class MyCalendar {
4040
}
4141

4242
public boolean book(int start, int end) {
43-
for (int i = 0; i < calendar.size(); i++) {
44-
if (calendar.get(i)[0] < end && start < calendar.get(i)[1]) {
43+
for (int[] event : calendar) {
44+
if (event[0] < end && start < event[1]) {
4545
return false;
4646
}
4747
}

0 commit comments

Comments
 (0)