Cody

Problem 731. Given a window, how many subsets of a vector sum positive

Given a vector:

[1 0 -1 3 2 -3 1]

and a window of 2,

A sliding window would find:

   1 + 0 =  1
   0 - 1 = -1
  -1 + 3 =  2
   3 + 2 =  5
   2 - 3 = -1
  -3 + 1 = -2

Meaning that three of the windows were positive.

Given a vector and a window, how many of the windows sum to be positive, not zero or negative?

Solution Stats

47.43% Correct | 52.57% Incorrect
Last solution submitted on Sep 25, 2016

Problem Comments

Solution Comments

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more