I'd almost be tempted to do something like this ..
int[] levels = new int[5] {0, 0, 0, 0, 0};
and then when you do
if (seller[i].articles < 50)
seller[i].level = 1;
that becomes something like :-
if (seller[i].articles < 50)
(
seller[i].level = 1;
levels[seller[i].level] += 1;
)
...and so forth so all the calcs are done in one pass, unlike what you suggest
the only issue I have even with my own approach, is that arrays are indexed by '0', therefore levels[0] is wasted in the above (but there's a correspondance to your levels 1-4)
I'd have to think if
int[] levels = new int[4] {0, 0, 0, 0};
and using
levels[seller[i].level -1] += 1;
is better.
I don't know if anyone else agrees or not, but I hate traversing data sets multiple times where a single pass will do ...
Since you only indicate 4 levels, I think an array is justified - if you had an arbitrary number of levels I'd likely use a hash-map or such where seller[i].level -1 is the index in the hash-map and count is the value
I still worry (probably too much about what I dont see here - if ths is the only place in the code that modifies levels[], then ok, else I'd be thinking about checking that either seller[i].level or seller[i].level -1 was in the range of the array bounds, also depending on the decision or not to map your levels 1-4 to the array subscripts 0-3
thats my 2 cents worth