Problem: There are N squares arranged in a row, numbered 1, 2, ..., N from left to right. You are given a string S of length N consisting of `.` and `#`. If the i-th character of S is `#`, Square i contains a rock; if the i-th character of S is `.`, Square i is empty.  In the beginning, Snuke stands on Square A, and Fnuke stands on Square B.  You can repeat the following operation any number of times:    * Choose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.  You want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.  Determine whether this is possible.

Submission attempts (in order):
N ,A ,B ,C ,D = list(map(int,input().split()))
S = input()

def judgeArrive(S , x , y):
  flag = "Yes"
  while flag == "Yes" and (not x == y):
    if S[x:x+2] == "##":
        flag = "No"
        print(x)
    elif S[x:x+2] == "#.":
        x +=2
        print(x)
    elif S[x:x+2] == "..":
        x +=2
        print(x)
    elif S[x:x+2] == ".#":
        x +=1
        print(x)
    else:
        x +=1
        print(x)
  return flag
        
def judgeJumpOver(S, x , y):
  flag = "No"
  for i in range(y - 2):
    if S[x:x+3] == "...":
      flag = "Yes"
      break
  return flag

flag = "Yes"
if(C > D):
  flag = judgeJumpOver(S, B, D)
flag = judgeArrive(S, B, D)
flag = judgeArrive(S, A, C)
print(flag)

N ,A ,B ,C ,D = list(map(int,input().split()))
S = input()

def judgeArrive(S, x , y):
  flag = "Yes"
  while flag == "Yes" and (not x == y):
    if S[x:x+2] == "##":
        flag = "No"
        print(x)
    elif S[x:x+2] == "#.":
        x +=2
        print(x)
    elif S[x:x+2] == "..":
        x +=2
        print(x)
    elif S[x:x+2] == ".#":
        x +=1
        print(x)
    else:
        x +=1
        print(x)
  return flag
        
def judgeJumpOver(S, x , y):
  flag = "No"
  for x in range(y - 2):
    if S[x:x+3] == "...":
      flag = "Yes"
      print(flag)
      print(S[x:x+3])
      break
    print(S[x:x+3])

  return flag

result = "Yes"
if(C > D):
  result = judgeJumpOver(S, B, D)
print(result)
if(result == "Yes"):
  result = judgeArrive(S, B, D)
print(result)
if(result == "Yes"):
  result = judgeArrive(S, A, C)
print(result)
  


N ,A ,B ,C ,D = list(map(int,input().split()))
S = input()

def judgeArrive(S, x , y):
  flag = "Yes"
  while flag == "Yes" and (not x == y):
    if S[x:x+2] == "##":
        flag = "No"
        print(x)
    elif S[x:x+2] == "#.":
        x +=2
        print(x)
    elif S[x:x+2] == "..":
        x +=2
        print(x)
    elif S[x:x+2] == ".#":
        x +=1
        print(x)
    else:
        x +=1
        print(x)
  return flag
        
def judgeJumpOver(S, x , y):
  flag = "No"
  for i in range(y - 2):
    if S[x:x+3] == "...":
      flag = "Yes"
      break
  return flag

flag = "Yes"
if(C > D):
  flag = judgeJumpOver(S, B, D)
if(flag == "Yes"):
  flag = judgeArrive(S, B, D)
if(flag == "Yes"):
  flag = judgeArrive(S, A, C)
print(flag)


N ,A ,B ,C ,D = list(map(int,input().split()))
S = input()
 
def judgeArrive(S, x, y):
    flag = "Yes"
    for i in range(x-1 ,y-2):
        if S[i] ==  S[i+1] == "#":
            flag = "No"
    return flag

def judgeJumpOver(S, x , y):
    flag = "No"
    for i in range(x-1 ,y):
        if S[i-1] ==  S[i] ==  S[i+1] == ".":
            flag = "Yes"
            break
    return flag
 
result = "Yes"
if(C > D):
    result = judgeJumpOver(S, B, D)
if(result == "Yes"):
    result = judgeArrive(S, B, D)
if(result == "Yes"):
    result = judgeArrive(S, A, C)
print(result)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted