Question: how to solve this problem using c++ 6. [20 pts] vectors Given a vector v, a subvector w is defined as a vector made up
![how to solve this problem using c++ 6. [20 pts] vectors](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3e87a89d73_79466f3e87a0d922.jpg)
how to solve this problem using c++
6. [20 pts] vectors Given a vector v, a subvector w is defined as a vector made up of contiguous elements of the vector v. That is, a subvector is to a vector much like a substring is to a string. Here is an example of a vector: 7 2-4 618 5 0 And a subvector: -6 18 5 Write a function that takes as input a vector of ints and returns the longest subvector where all entries are non-negative. For the above example your function should return 18 5 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
