<awangdev>523. Continuous Subarray Sum_2.java
public boolean checkSubarraySum(int[] nums, int k) {
        if (nums == null || nums.length == 0) return false;
        int n = nums.length;
        int[] dp = new int[n]; 
        dp[0] = nums[0];
        for (int i = 1; i < n; i++) {
            dp[i] = dp[i - 1] + nums[i];
        }
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                int sum = dp[j] - dp[i] + nums[i];
                if (sum == k || (k != 0 && sum % k == 0)) {
                    return true;
                }
            }
        }

        return false;
    }
public boolean var_0 ( int [ ] var_1 , int var_2 ) {
  if ( var_1 == null || var_1 . length == 0 ) return false ;
  int var_6 = var_1 . length ;
  int [ ] var_7 = new int [ var_6 ] ;
  var_7 [ 0 ] = var_1 [ 0 ] ;
  for ( int var_9 = 1 ;
  var_9 < var_6 ;
  var_9 ++ ) {
    var_7 [ var_9 ] = var_7 [ var_9 - 1 ] + var_1 [ var_9 ] ;
  }
  for ( int var_9 = 0 ;
  var_9 < var_6 ;
  var_9 ++ ) {
    for ( int var_10 = var_9 + 1 ;
    var_10 < var_6 ;
    var_10 ++ ) {
      int var_11 = var_7 [ var_10 ] - var_7 [ var_9 ] + var_1 [ var_9 ] ;
      if ( var_11 == var_2 || ( var_2 != 0 && var_11 % var_2 == 0 ) ) {
        return true ;
      }
    }
  }
  return false ;
}
