Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined), problem: (A) Gotta Catch Em’ All! Solution in C/C++

By |2017-04-07T22:10:20+00:00January 16th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , , |

#include<stdio.h> #include<string.h> int main(){ int i,j; char ch; char a[100005]; int b[256]={0}; while((ch=getchar())!=EOF){ b[ch]++; } char *d="ulbasr"; int min=b['B']; b['u']=b['u']/2; b['a']=b['a']/2; for(i=0;i<strlen(d);i++){ if(min>b[d[i]]){ min=b[d[i]]; } } printf("%d",min); }