5/6 whats wrong with my code?


I dont understand whats not working, it gives me the error

Oops, try again. Make sure to print each word from the user's text to the console unless that word is the word to be redacted; if it is, print REDACTED (all caps!).

puts "Text to search through: "
text = gets.chomp
puts "Word to be redacted: "
redact = gets.chomp
words = text.split(" ")
words.each do |words|
if words == redact
print "REDACTED"
print words + " "


Your placeholder variable should have a different name than the original array.

 /-  orignal array
words.each do |words|
                  ^- placeholder variable for each element in the array