79309308

Date: 2024-12-26 11:11:04
Score: 0.5
Natty:
Report link

Find below a solution, may be not the best one

[c,k]=gsort(c,'r','i');
i=find(c(1:$-1,1)<>c(2:$,1));
r=[];l=1;
for j=[i(1:$),size(c,1)]
   r=[r;c(j,1),sum(c(l:j,2))];
   l=j+1;
end
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Serge Steer