Skip to content

Instantly share code, notes, and snippets.

@krisys
Created November 29, 2011 17:38
Show Gist options
  • Save krisys/1405657 to your computer and use it in GitHub Desktop.
Save krisys/1405657 to your computer and use it in GitHub Desktop.
Solution to TopCoder SRM 525 - 250 pointer Div 2
string RainyRoad::isReachable(vector <string> road) {
int n = road[0].length();
if(road[0][0] == 'W' || road[0][n-1] == 'W')
return "NO";
for(int i = 0 ;i < n; i++){
if(road[0][i] == 'W' && road[1][i] == 'W')
return "NO";
}
return "YES";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment