Problem: You are given a string S. Each character of S is uppercase or lowercase English letter. Determine if S satisfies all of the following conditions:    * The initial character of S is an uppercase `A`.   * There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).   * All letters except the `A` and `C` mentioned above are lowercase.

Submission attempts (in order):
 = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].islower():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'
    
print(ans)

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].isupper():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'

print(ans)

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
print(count)
if count == 1:
    flag = flag + 1
print(flag)
count = 0
for i in range(1,L-1):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
for i in range(2,L-2):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
           
#print(j)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L-1):
    print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted