729. 我的日程安排表 I

class MyCalendar {

    int [] month = new int[30];
    public MyCalendar() {


    }

    public boolean book(int start, int end) {
        boolean p = true;


        if (month[start] == 1) {
            p = false;
        }

        else {
            while (p) {
                int i = start;
                month[i] = 1;
                if (month[i+1] == 1) {
                    return p = false;
                }
                i = i+1;
            }
        }
        return p;
    }

}