Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 577 Bytes

Day 118.md

File metadata and controls

28 lines (23 loc) · 577 Bytes

Day 118

Link: https://x.com/kom_senapati/status/1784420867990294748

Approach

  • Returned "Invalid" for boundary conditions and then used if elif ladder to solve the problem

Code

class Solution:
    # @param A : integer
    # @return a strings
    def solve(self, A):
        if 1>A or A>12:
            return "Invalid"
        elif A>11:
            return "Winter"
        elif A>8:
            return "Autumn"
        elif A>5:
            return "Summer"
        elif A>2:
            return "Spring"
        elif A>=1:
            return "Winter"