# Write a Python program to Filter Strings combination of K substrings # Python3 code to demonstrate working of # Filter Strings  combination of K substrings# Using permutations() + map() + join() + set() + loopfrom itertools import permutations  # initializing listtest_list = ["geeks4u", "allbest", "abcdef"]  # printing stringprint("The original list : " + str(test_list))  # initializing substring listsubstr_list = ["s4u", "est", "al", "ge", "ek", "def", "lb"]  # initializing K K = 3  # getting all permutationsperms = list(set(map(''.join, permutations(substr_list, r = K))))  # using loop to check permutations with listres = []for ele in perms:    if ele in test_list:        res.append(ele)  # printing results print("Strings after joins : " + str(res))