0, 2, 0, -2, 0, 2, 0, -2, ...
Generate the first n terms of a periodic sequence defined as
f(x) = 0, 2, 0, -2, 0, 2, 0, -2, ..., for x = 1, 2, 3, 4, 5, 6...
Count consecutive 0's in between values of 1
So you have some vector that contains 1's and 0's, and the goal is to return a vector that gives the number of 0's between each ...
2年以上 前
解決済み
Insert certain elements into a vector.
We start with vector V. Some values W will be inserted into V, at positions U.
Say, |V| contains |[1 2 3 4 5]| and |W| is |[0...
2年以上 前
解決済み
Sort (high on middle, low on ends)
Sort the vector of numbers in order low-high-low. Even numbers appear in ascending order on the left and odd numbers appear in d...
2年以上 前
解決済み
Oh Zero Zero Zero!!!
Hello all,
So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...