Here are the additional challenges I gave Richard:
∘ You'll get a nested structure where the leaf nodes are "strings" (i.e. character vectors). Return a similar structure, but each such vector replaced by a scalar indicating if it is valid DNA.
∘ Check if a given string is valid DNA or RNA, but not a mixture.
∘ Ignore whitespace and case.