Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
# YYMM or MMYY or AMBIGUOUS or NA
s = input()

def year_chack(s):
    if not (s == "00"):
        return True
    else :
        return False

def manth_check(s):
    if ( s == '01' or
            s == '02' or
            s == '03' or
            s == '04' or
            s == '05' or
            s == '06' or
            s == '07' or
            s == '08' or
            s == '09' or
            s == '10' or
            s == '11' or
            s == '12'):
        return True
    else :
        return False

frond = s[0] + s[1]
back = s[2] + s[3]


status = ""

#YYMM
if (year_chack(frond) and manth_check(back)):
    status = status + "1"
else :
    status = status + "0"

#MMYY
if (manth_check(frond) and year_chack(back)):
    status = status + "1"
else :
    status = status + "0"

if (status == "11"):
    print("AMBIGUOUS")
elif (status == "00"):
    print("NA")
elif (status == "01"):
    print("MMYY")
elif (status == "10"):
    print("YYMMM")






# YYMM or MMYY or AMBIGUOUS or NA
s = input()

def year_chack(s):
    return True

def manth_check(s):
    if ( s == '01' or
            s == '02' or
            s == '03' or
            s == '04' or
            s == '05' or
            s == '06' or
            s == '07' or
            s == '08' or
            s == '09' or
            s == '10' or
            s == '11' or
            s == '12'):
        return True
    else :
        return False

frond = s[0] + s[1]
back = s[2] + s[3]


status = ""

#YYMM
if (year_chack(frond) and manth_check(back)):
    status = status + "1"
else :
    status = status + "0"

#MMYY
if (manth_check(frond) and year_chack(back)):
    status = status + "1"
else :
    status = status + "0"

if (status == "11"):
    print("AMBIGUOUS")
elif (status == "00"):
    print("NA")
elif (status == "01"):
    print("MMYY")
elif (status == "10"):
    print("YYMMM")






# YYMM or MMYY or AMBIGUOUS or NA
s = input()

def year_chack(s):
    return True

def manth_check(s):
    if ( s == '01' or
            s == '02' or
            s == '03' or
            s == '04' or
            s == '05' or
            s == '06' or
            s == '07' or
            s == '08' or
            s == '09' or
            s == '10' or
            s == '11' or
            s == '12'):
        return True
    else :
        return False

frond = s[0] + s[1]
back = s[2] + s[3]


status = ""

#YYMM
if (year_chack(frond) and manth_check(back)):
    status = status + "1"
else :
    status = status + "0"

#MMYY
if (manth_check(frond) and year_chack(back)):
    status = status + "1"
else :
    status = status + "0"

if (status == "11"):
    print("AMBIGUOUS")
elif (status == "00"):
    print("NA")
elif (status == "01"):
    print("MMYY")
elif (status == "10"):
    print("YYMM")






Verdicts: Wrong Answer

Wrong Answer

Accepted