An implementation of the Euclid Algorithm, to find the greatest common divisor for an array of integers.
Imagining we have an array of neighbors, like this [1,1,1,0,1,1,1,1], when 1 represent the lights are on, and 0 represent the lights are off, this algorithm will apply different rules depending on the state of every light, for several iterations
This one just says if the word is a palindrome word or not. A palindrome word can be written the same way from begining to end, or end to begining