Jelly, 21 14 12 10 bytes
“dʋ»e€µṪ<Ẹ
Takes input in lowercase. Adaption of Neil's method
Golfs:
- -10 bytes by changing the compressed string
- -5 bytes by adapting coltim's method
- -2 bytes by using Neil's method
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