question about reduce()
hi guys the reduce method puts total, currentvalue, currentindex, arr in this order always doesn’t matter what you name them?

array.reduce(function(total, currentvalue, currentindex, arr), initialvalue)

`
yws, the reduce method will pass those arguments always in that order
you can use the negative lookbehind (?<!sub +) to skip matching "sub " in front of “total”.

(?<=(?<!sub +)(total amount|\btotal\b|total due|total amount due)\s+)(zar|r|)[\s-$\d,.]+

[[image]](https://aws1.discourse-cdn.com/uipath/original/3x/7/7/771d2a72ff53c33207c48813c7b379782be96d4f.png "image") applying and factorization, we get, also changing by reversing n and dnote: - try to factorize that term which help in reducing expression. method a.increment() overlaps in class b.   
 therefore, regardless of the type of the variable obj, will be called the method corresponding to the actual type of the object - that is, b.increment().  
 
this method will use the variable i, declared in the same class b and having an initial value of 10.  
 
the resulting value - 11. [@najoua.abbaci](/u/najoua.abbaci)

mabye the flow can be adopted to following:

assign:

leftside: drresult (datatype: datarow)

right side:

dt\_datepv.asenumerable.orderby(function ( r ) datetime.parseexact(r(0).tostring.trim, “dd.mm.yyyy”, system.globalization.cultureinfo.currentuiculture.datetimeformat)).last()

so… howdy and welcome to the forum!

take a closer look at the comment on line 13…it suggests using a different method

you are incrementing enemyindex, but not quite in the correct place…it should be the final statement in your while(enemyindex…) loop

like item 1, don’t forget the instructions in the c… finding the correct answer here is important, but perhaps equally important is finding it using the method of matrix reduction, since those are the instructions.the augmented matrix is4 -2 -5 -514 -1 -2 -364 -2 4 -24you'll have to forgive the poor formatting. this answer box doesn't have a proper math symbol editor.using elementary row operations, the reduced row echelon form of the augmented matrix is1 0 0 -60 1 0 60 0 1 3from which we conclude that the system has a unique solution (-6,6,3). ?solution 
step 1:
we have to draw the graph of form r to r. 
step 2:
the graph of f is the set of all points (x,f(x)) with x in the domain of f.
we take x in [-4,4]
and we will find the separate values of y for separate intervals.
 
 
 

 
......(1)
 

 

 

using x values along x-axis and along y-axis we get the graph of given function form r to r.
step 3:
the graph is as follow For the most part the code is pretty good. You made a few minor errors that would be expected since you are still starting out but you should really work on consistency in indentation since it is harder to read and edit (you will really notice this later on) so you should get into the habit of trying to make your code look nice early on.



  

I commented in a few places where I made changes.



```
#include <iostream>
#include <cstdlib> //needed for system() because not all compilers include this header by default

using namespace std;

//the way you are using your functions you can/should have them all return void
void getlist(int[], int&);
void putlist (const int[], int);
void mean_average (const int[], int);
void MinIndex (const int[], int);
void left_rotate (int[], int);

const int MAXSIZE = 50;

int main()
{
	int mylist[MAXSIZE];
	int num_items;

	getlist(mylist, num_items);
	putlist(mylist, num_items);
	MinIndex(mylist, num_items);
	mean_average(mylist, num_items);
	left_rotate(mylist, num_items);

	system ("PAUSE");
	return 0;
}

void getlist(int mylist[], int &num_items)
{
	cout << "Enter the number of Array Elements, Maximum " << MAXSIZE << endl;
	cin >> num_items;

	for( int i = 0; i < num_items; i++ )
	{
		cout << "Enter the next array element: ";
		cin >> mylist[i];
	}
	cout << endl;
}

void putlist(const int mylist[], int num_items)
{
	cout << endl << "Array elements\n";
	for( int i = 0; i < num_items; i++ )
	{
		cout << i << " " << mylist [i] << endl;
	}
}

void MinIndex(const int mylist[], int num_items)
{
	int min = 0; //assuming min index is 0 (not the actual value there)

	for( int i = 0; i < num_items; i++ )
	{
		if( mylist[i] < mylist[min] ) //compare the values at each index
			min = i;
	}

	cout << endl << "The address of the smallest number is " << min << endl;
}

void mean_average(const int mylist[],int num_items)
{
	int sum = 0;
	float average;

	for( int i= 0; i < num_items; i++ ) //use < if your are using num_items or <= if you use num_items-1
	{
		sum += mylist[i];
	}
	average = sum / num_items;

	cout << endl << "The average value is: " << average << endl;
}

//used a bit of your code but rewrote most of left_rotate (this seems more like a left shift)
void left_rotate(int mylist[], int num_items)
{
	int temp = mylist[0];
	for( int i = 0; i < num_items-1; i++ )
	{
		mylist[i] = mylist[i+1];
	}
	mylist[num_items-1] = temp;

	cout << endl << "The new array elements are:\n";
	for( int i = 0; i < num_items; i++ )
		cout << mylist[i] << " ";
	cout << endl << endl;
}
``` >> [x,y] = ismember(a,b);
>> [~,z] = sort(y(x));
>> v = find(x);
>> r = reshape(v(z),2,[]).'
r =
 2 9
 4 8
 5 7 ok so, you're simply making a wrong aggregation in your y-axis. what you want to do is make 3 aggregations of type sum, each one for a specific category (men-women-children), like the following:

[[image]](https://aws1.discourse-cdn.com/elastic/original/3x/4/4/441907755076ca3a9417b959036a79f906d45448.png "image")

though, if you want to make something more professional and good-looking, since you're interes…