Solution to Longest Common Prefix

Two way: compare char by char or compare string by string