comefrom: <doocs>2261.K Divisible Elements Subarrays_1.py
code: def countDistinct( nums: List[int], k: int, p: int) -> int:
      n = len(nums)
      s = set()
      for i in range(n):
          cnt = 0
          t = ""
          for j in range(i, n):
              if nums[j] % p == 0:
                  cnt += 1
              if cnt <= k:
                  t += str(nums[j]) + ","
                  s.add(t)
              else:
                  break
      return len(s)
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : int , var_2 : int ) -> int :
      var_3 = len ( var_0 )
      var_4 = set ( )
      for var_5 in range ( var_3 ) :
          var_6 = 0
          var_7 = ""
          for var_8 in range ( var_5 , var_3 ) :
              if var_0 [ var_8 ] % var_2 == 0 :
                  var_6 += 1
              if var_6 <= var_1 :
                  var_7 += str ( var_0 [ var_8 ] ) + ","
                  var_4.add ( var_7 )
              else :
                  break
      return len ( var_4 )
  