Problem: We have a bingo card with a 3\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.  The MC will choose N numbers, b_1, b_2, \cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.  Determine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.

Submission attempts (in order):
a1 = [int(x) for x in input().split()]
a2 = [int(x) for x in input().split()]
a3 = [int(x) for x in input().split()]
n = int(input())
b = []
for _ in range(n):
    b.append(input())
res = ""
for x in b:
    if int(x) == int(a1[0]):
        print(x)
        res += "1"
    if int(x) == int(a2[1]):
        res += "1"
    if int(x) == int(a3[2]):
        res += "1"
if res == "111":
    print("Yes")
else:
    print("No")


a1 = [int(x) for x in input().split()]
a2 = [int(x) for x in input().split()]
a3 = [int(x) for x in input().split()]
n = int(input())
b = []
for _ in range(n):
    b.append(input())
res = ""
for x in b:
    if int(x) == int(a1[0]):
        res += "1"
    if int(x) == int(a2[1]):
        res += "1"
    if int(x) == int(a3[2]):
        res += "1"
    if int(x) == int(a1[0]):
        res += "2"
    if int(x) == int(a1[1]):
        res += "2"
    if int(x) == int(a1[2]):
        res += "2"
    if int(x) == int(a2[0]):
        res += "3"
    if int(x) == int(a2[1]):
        res += "3"
    if int(x) == int(a2[2]):
        res += "3"
    if int(x) == int(a3[0]):
        res += "4"
    if int(x) == int(a3[1]):
        res += "4"
    if int(x) == int(a3[2]):
        res += "4"
    if int(x) == int(a1[0]):
        res += "5"
    if int(x) == int(a2[0]):
        res += "5"
    if int(x) == int(a3[0]):
        res += "5"
    if int(x) == int(a1[1]):
        res += "6"
    if int(x) == int(a2[1]):
        res += "6"
    if int(x) == int(a3[1]):
        res += "6"
    if int(x) == int(a1[2]):
        res += "7"
    if int(x) == int(a2[2]):
        res += "7"
    if int(x) == int(a3[2]):
        res += "7"
    if int(x) == int(a1[2]):
        res += "8"
    if int(x) == int(a2[1]):
        res += "8"
    if int(x) == int(a3[0]):
        res += "8"
if res == "111" or res == "222" or res == "333" or res=="444" or res=="555" or res=="666" or res=='777' or res =="888":
    print("Yes")
else:
    print("No")


a1 = [int(x) for x in input().split()]
a2 = [int(x) for x in input().split()]
a3 = [int(x) for x in input().split()]
n = int(input())
b = []
for _ in range(n):
    b.append(int(input()))
res = []
for x in b:
    for i in range(3):
        if x == a1[i]:
            res += "1"
        if x == a2[i]:
            res += "2"
        if x == a3[i]:
            res += "3"
    if x == a1[0] or x == a2[0] or x == a3[0]:
        res += "4"
    if x == a1[1] or x == a2[1] or x == a3[1]:
        res += "5"
    if x == a1[2] or x == a2[2] or x == a3[2]:
        res += "6"
    if x == a1[0] or x == a2[1] or x == a3[2]:
        res += "7"
    if x == a1[2] or x == a2[1] or x == a3[0]:
        res += "8"
if res.count("1")>=3 or res.count("2")>=3 or res.count("3")>=3 or res.count("4")>=3 or res.count("5")>=3 or res.count("6")>=3 or res.count("7")>=3 or res.count("8")>=3:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Accepted