Skip to main content
2 of 6
added 18 characters in body

#JavaScript ES6, 85 bytes

As an anonymous function

a=>["Blinky","Inky","Pinky","Clyde"].filter(c=>!a.includes(c)||a.includes("Pac-Man"))

Today I learned about this filter function. Fun!

15 bytes saved thanks to Neil.

Usage:

(a=>{g=["Blinky","Inky","Pinky","Clyde"];return (a.includes("Pac-Man")?g:g.filter(c=>!a.includes(c)))})(["Pac-Man"])
> ["Blinky","Inky","Pinky","Clyde"]
(a=>{g=["Blinky","Inky","Pinky","Clyde"];return (a.includes("Pac-Man")?g:g.filter(c=>!a.includes(c)))})(["Pinky"])
> ["Blinky","Inky","Clyde"]
(a=>{g=["Blinky","Inky","Pinky","Clyde"];return (a.includes("Pac-Man")?g:g.filter(c=>!a.includes(c)))})([])
> ["Blinky","Inky","Pinky","Clyde"]