leetcode:add implementation for Longest Common Prefix