#include <stdio.h>
#include <stdlib.h>

/**
 * Exercise 2-5.  Write the function any(s1,s2), which 
 * returns the first location in the string s1 where 
 * any character from the string s2 occurs, or  -1 if 
 * s1 contains no characters from s1.
 */

bool charin(char, char*);
int  any(char*,char*);

int main(void)
{
   printf("Index = %d\n", any("samplestuff","uyz"));
}

int any(char* s1, char* s2)
{
   int i;
   for(i=0; s1[i]!='\0'; i++)
   {
      if(charin(s1[i],s2)) return i;
   }
   return -1;
}

bool charin(char c, char* s)
{
   int i;
   for(i=0; s[i]!='\0'; i++)
      if(s[i] == c) return TRUE;
   return FALSE;
}
