- Arrays, Mathematical, partition, subarray

Split array into three continuous subarrays with negative, 0 and positive product respectively

#include using namespace std;  void PrintAllArrays(int arr[], int N){                int l = -1, r = -1;          for (int i = 0; i < N; i++) {                  if (l == -1) {                          if (arr[i] == -1) {                  l = i;                break;            }                          if (arr[i] == 0) {                  cout 0) {            r = i;            break;        }    }              if (l == -1 || r == -1 || l >= r        || count(arr + l, arr + r + 1, 0) == 0) {          cout