Adding KMP and Union_Find