Function that finds the shortest subsequence
def findShortestSubsequence ( dp , a , index , primeFactors ) : NEW_LINE INDENT n = len ( a ) NEW_LINE for j in range ( index , n ) : NEW_LINE INDENT bitmask = 0 NEW_LINE for p in range ( len ( primeFactors ) ) : NEW_LINE DEDENT DEDENT