more Shortest Repetition

Lua, Ruby