function calc_count(arr) {
let counts = {};
let result = [];
for (let i = 0; i < arr.length; i++) {
counts[arr[i]] = counts[arr[i]] ? counts[arr[i]] + 1 : 1;
result.push(counts[arr[i]]);
}
return result;
}
function auto_seq(){
var rows = contentPane.curLGP.getTDRow(contentPane.curLGP.currentTDCell);
var nums = [];
for (let i = 1; i <= rows; i++) {
nums.push(_g().getCellValue("N" + i, null));
}
return {index:nums.indexOf("辅助1"),array:nums};
}
function push_row(){
var {index:strow,array:nums} = auto_seq();
var newrows = calc_count(nums);
for(let i = 0;i<nums.length;i++){
if(i<=strow){ continue }
_g().setCellValue("O"+(i+1),null,newrows[i]);
}
}
push_row()