UVA 11661 - Burger Time? Shipu Ahamed - 01 Sep 2020 Problem PDFSolution:#include #include char a[2000010]; int main() { int n,i,d,min,f; while(scanf("%d",&n)==1) { if(n==0) break; scanf("%s",a); f=0; d=1; min=2000010; for(i=0;id) min=d; i--; d=1; break; } else if(a[i]=='Z') { min=0; f=1; break; } } } else if(a[i]=='D') { i++; for(i=i;id) min=d; i--; d=1; break; } else if(a[i]=='Z') { min=0; f=1; break; } } } else continue; } printf("%d\n",min); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11661/11661.cpp