static int getDayCountInMonth(int year, int month) { return [ 31, year % 4 == 0 ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ][month - 1]; }