“...The Return of the Archons...”
I don’t recall that episode. Refresh my memory.
Kirk and company encounter a planet run by a computer, aka Landru, who has complete control over the population of the planet.
The only time the people are “allowed” to do what they want is a time known as Festival. If I remember, it runs for about 12 hours and the people go slap crazy....much destruction, sexual aggressiveness, mayhem (or chicago on a saturday night). When festival is over, the people go back to being controlled by Landru.
The premise of the Purge reminded me of this episode.