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_3 : int , var_4 : int ) -> int :
      var_6 = len ( var_0 )
      var_8 = set ( )
      for var_10 in range ( var_6 ) :
          var_12 = 0
          var_14 = ""
          for var_15 in range ( var_10 , var_6 ) :
              if var_0 [ var_15 ] % var_4 == 0 :
                  var_12 += 1
              if var_12 <= var_3 :
                  var_14 += str ( var_0 [ var_15 ] ) + ","
                  var_8.add ( var_14 )
              else :
                  break
      return len ( var_8 )
  