Update LZWAlgorithm.lua

Deal with special case where the substring begins and ends with the same character