#include <iostream>
#include <vector>
using namespace std;
bool contains(int i_find, std::vector<int> list)
{
return list.empty() ? false : (*list.begin() == i_find ? true : contains(i_find, {list.begin()+1, list.end()}));
}
int main() {
printf("contains 0: %i\n", contains(0, {1,2,3,4}) ? 1 : 0);
printf("contains 1: %i\n", contains(1, {1,2,3,4}) ? 1 : 0);
printf("contains 2: %i\n", contains(2, {1,2,3,4}) ? 1 : 0);
printf("contains 3: %i\n", contains(3, {1,2,3,4}) ? 1 : 0);
printf("contains 4: %i\n", contains(4, {1,2,3,4}) ? 1 : 0);
printf("contains 5: %i\n", contains(5, {1,2,3,4}) ? 1 : 0);
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYm9vbCBjb250YWlucyhpbnQgaV9maW5kLCBzdGQ6OnZlY3RvcjxpbnQ+IGxpc3QpCnsKICByZXR1cm4gbGlzdC5lbXB0eSgpID8gZmFsc2UgOiAoKmxpc3QuYmVnaW4oKSA9PSBpX2ZpbmQgPyB0cnVlIDogY29udGFpbnMoaV9maW5kLCB7bGlzdC5iZWdpbigpKzEsIGxpc3QuZW5kKCl9KSk7Cn0KCmludCBtYWluKCkgewoJcHJpbnRmKCJjb250YWlucyAwOiAlaVxuIiwgY29udGFpbnMoMCwgezEsMiwzLDR9KSA/IDEgOiAwKTsKCXByaW50ZigiY29udGFpbnMgMTogJWlcbiIsIGNvbnRhaW5zKDEsIHsxLDIsMyw0fSkgPyAxIDogMCk7CglwcmludGYoImNvbnRhaW5zIDI6ICVpXG4iLCBjb250YWlucygyLCB7MSwyLDMsNH0pID8gMSA6IDApOwoJcHJpbnRmKCJjb250YWlucyAzOiAlaVxuIiwgY29udGFpbnMoMywgezEsMiwzLDR9KSA/IDEgOiAwKTsKCXByaW50ZigiY29udGFpbnMgNDogJWlcbiIsIGNvbnRhaW5zKDQsIHsxLDIsMyw0fSkgPyAxIDogMCk7CglwcmludGYoImNvbnRhaW5zIDU6ICVpXG4iLCBjb250YWlucyg1LCB7MSwyLDMsNH0pID8gMSA6IDApOwoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJcmV0dXJuIDA7Cn0=