Skip to main content
edited body
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21

C (cgggcc), 135 133 bytes

Expects ingredients and request as command line arguments (the last one is the request). The return value of the program is the result.

l[128],n;char*a;main(c,v)char**v;{for(++v;c---2;)for(a=*v++;*a;++l[*a++]);for(a=*v,n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}

C (cgg), 135 133 bytes

Expects ingredients and request as command line arguments (the last one is the request). The return value of the program is the result.

l[128],n;char*a;main(c,v)char**v;{for(++v;c---2;)for(a=*v++;*a;++l[*a++]);for(a=*v,n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}

C (gcc), 135 133 bytes

Expects ingredients and request as command line arguments (the last one is the request). The return value of the program is the result.

l[128],n;char*a;main(c,v)char**v;{for(++v;c---2;)for(a=*v++;*a;++l[*a++]);for(a=*v,n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}
Typo in byte count...
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21

C (cgg), 125135 133 bytes

Expects the firstingredients and request as command line arg to bearguments (the last one is the request, the rest are the ingredients). The return value of the program is the result.

l[128],n=2;char*a;mainn;char*a;main(c,v)char**v;{for(;n<c;++n++v;c---2;)for(a=v[n];*a;++l[*a++]a=*v++;*a;++l[*a++]);for(a=v[1]a=*v,n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}

C (cgg), 125 bytes

Expects the first command line arg to be the request, the rest are the ingredients. The return value of the program is the result.

l[128],n=2;char*a;main(c,v)char**v;{for(;n<c;++n)for(a=v[n];*a;++l[*a++]);for(a=v[1],n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}

C (cgg), 135 133 bytes

Expects ingredients and request as command line arguments (the last one is the request). The return value of the program is the result.

l[128],n;char*a;main(c,v)char**v;{for(++v;c---2;)for(a=*v++;*a;++l[*a++]);for(a=*v,n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}
Source Link
Peter Lenkefi
  • 1.7k
  • 10
  • 21

C (cgg), 125 bytes

Expects the first command line arg to be the request, the rest are the ingredients. The return value of the program is the result.

l[128],n=2;char*a;main(c,v)char**v;{for(;n<c;++n)for(a=v[n];*a;++l[*a++]);for(a=v[1],n=l[*a];*a;++a)n=*a-32&&l[*a]<n?l[*a]:n;return n;}