Counting all substrings with exactly k distinct characters
Consider 

public static void findSubstringsWithKDistinctCharacters(String s, int k) {
    char[] letters = s.toCharArray();

    for (int i = 0, n = letters.length - k; i &lt;= n; i++) {
        Set&lt;Character&gt; uniques = new LinkedHashSet&lt;Character&gt;();

        for (int j = i, m = i + k; j &lt; m; j++) {
            uniques.add(letters[j]);
        }

        if (uniques.size() == k) {
            System.out.println("substring : " + uniques);
        }
    }
}


This is a simpler version of what you wrote.  It gets rid of your r variable entirely, as it is unnecessary.  

I also changed the names of sArr and set to things that I find more descriptive.  

I moved the code into its own method so that it can be called multiple times.  

There are two reasons to move the declaration of uniques into the loop.  One, this is less code.  Two, if you changed this code to produce a list of results rather than print the results, the other version doesn't work.  You'd have multiple copies of whatever the last set was rather than unique copies.  I'd only use the clear version if I knew that performance of this method was a bottleneck.  

Bug

Unfortunately, both this version and your original do not match the linked problem statement:  


  Input: aba, k = 2
  Output: 3
  Possible substrings are {"ab", "ba", "aba"}
  
  Input: aa, k = 1
  Output: 3
  Possible substrings are {"a", "a", "aa"}


They only find two solutions for each of these, as they stop counting once there are k characters (distinct or not) in the substring.  They should keep going until they've verified that the next character isn't a duplicate of a character already in the substring.  

Complexity

Calling the time complexity \$\mathcal{O}(n\cdot k)\$ is reasonable.  It's slightly more accurate to say that it is \$\mathcal{O}(n\cdot k - k^2)\$, but \$k\$ is never larger than \$n\$ so it's reasonable to view this as \$\mathcal{O}(n\cdot k)\$.  Note that if you fix the algorithm, it would be \$\mathcal{O}(n^2)\$, as the worst case is an input of all the same character.  That gives substrings up to length \$n\$ where this is limited to length \$k\$.