How to Find the longest common prefix of some string?
A similar question has been answered nicely on the thread on geeksforgeeks.
tnq @pratik_gadhiya.