@@ -0,0 +1,1135 @@
+//  Copyright 2021 The KeepTry Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A//%0A%0Apackage math;%0A%0Apublic class Leetcode1154DayoftheYear %7B%0A  /*%0A  Leap year:%0A    y %25 4 == 0 && (y %25 100 != 0  %7C%7C  y %25 400 == 0)%0A  */%0A  private static int days%5B%5D = new int%5B%5D %7B0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31%7D;%0A%0A  public int dayOfYear(String s) %7B%0A    int y = Integer.valueOf(s.substring(0, 4)),%0A        m = Integer.valueOf(s.substring(5, 7)),%0A        d = Integer.valueOf(s.substring(8));%0A%0A    if (m %3E 2 && y %25 4 == 0 && (y %25 100 != 0 %7C%7C y %25 400 == 0)) d++;%0A    while (--m %3E 0) d += days%5Bm%5D;%0A    return d;%0A  %7D%0A%7D%0A

1154. Day of the Year