Your task is to write a function which takes a string and an integer K and it reports how many different K-grams (K-character substrings) the string has. You are given an algorithm for construction of the suffix array. For simplicity, this algorithm has time complexity $O(n \log^2 n)$. Except for constructing the suffix array, your algorithm should run in linear time. Source code templates can be found in [git](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master).