Skip to main content
8 of 8
deleted 291 characters in body

Jelly, 21 14 12 10 bytes

“dʋ»e€µṪ<Ẹ

Try it online!

Takes input in lowercase. Adaption of Neil's method

Golfs:

How it works

“dʋ»e€µṪ<Ẹ - Main link. Takes S on the left
“dʋ»       - Compressed string; Yield "dep"
     €     - For each character in "dep":
    e      -   Is it in S?
      µ    - Use this triplet as the new argument
       Ṫ   - Take the final element (1 if p is present, else 0)
         Ẹ - Are either "d" or "e" in S?
        <  - The tail is 0 and either "d" or "e" are in S