Class Solution

java.lang.Object
g1101_1200.s1185_day_of_the_week.Solution

public class Solution extends Object
1185 - Day of the Week.<p>Easy</p> <p>Given a date, return the corresponding day of the week for that date.</p> <p>The input is given as three integers representing the <code>day</code>, <code>month</code> and <code>year</code> respectively.</p> <p>Return the answer as one of the following values <code>{&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;}</code>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> day = 31, month = 8, year = 2019</p> <p><strong>Output:</strong> &ldquo;Saturday&rdquo;</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> day = 18, month = 7, year = 1999</p> <p><strong>Output:</strong> &ldquo;Sunday&rdquo;</p> <p><strong>Example 3:</strong></p> <p><strong>Input:</strong> day = 15, month = 8, year = 1993</p> <p><strong>Output:</strong> &ldquo;Sunday&rdquo;</p> <p><strong>Constraints:</strong></p> <ul> <li>The given dates are valid dates between the years <code>1971</code> and <code>2100</code>.</li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • dayOfTheWeek

      public String dayOfTheWeek(int day, int month, int year)