import math


def k_partition(seq, k, kmer_len, stride_len):
	"""
    Return k-partition minhash sketch fingerprint of sequence.

    Parameters
    ----------
    seq : string sequence to perform bottom-k sketch on
    k : number of hash value representatives in k-partition sketch
	kmer_len : int the length of the k-mers of the sequence
	stride_len : int the stride length in extracting k-mers from the sequence

    Returns
    -------
    fingerprint : list of ints
        The k-partition fingerprint sketch of the sequence.
    """
	n = len(seq)
	p_size = math.floor(n/k)
	hashes = []

	for i in range(k):
		j = i * p_size
		min_value = float('inf')
		while j < (i+1) * p_size and j < n:
			if hash(seq[j:j+kmer_len]) < min_value:
				min_value = hash(seq[j:j+kmer_len])
				j += stride_len
		hashes.append(min_value)

	return hashes