wrong output
Piyush and magical park wrong output
You are using a somewhere wrong approach in your solution, You have to use these conditions for getting the correct answer,
- if(S<K)
{
break;
} -
if(ar[i][j]=='.') { S=S-2; S--; } -
if(ar[i][j]=='*') { S=S+5; S--; } -
if(ar[i][j]=='#') { N=N+1; } -
if(ar[i][j]=='#' && i==N-1) { break; }
Plz use these conditions only.