Question: The input can only include two chemical elements: `C` and `H`
The program must control.
How can I provide that?

```
if (formul.Contains('C') == true && formul.Contains('H') == true)
    return true;

```

When my input is `HCA` it is still true. I want it only includes `C` and `H`.

Answer: 
```cs
using System.Linq; \\put this on top

return formul.All(c => c == 'C' || c == 'H');

```

This will return `true` if all characters of `formul` string are either 'C' or 'H'
Chemical formulas (as far as I know) can contain also numbers, so you have to take that into account as well, here is my idea of solving problem:

```
return ! formula.Any(ch => char.IsLetter(ch) && ch != 'C' && ch != 'H');

```

It checks wheter any letter in a formula is different from `C` or `H`. If there's letter other than `C` or `H`, it returns false, true otherwise.