79313729

Date: 2024-12-28 12:06:26
Score: 0.5
Natty:
Report link

In Scilab, here is a straightforward solution, provided that c's first column is already sorted:

i =  [c(2:$,1)~=c(1:$-1,1) ; %T];
tmp = [0 ; cumsum(c,"r")(i, 2)];
res = [c(i,1), tmp(2:$)-tmp(1:$-1)]

yielding

--> res = [c(i,1), tmp(2:$)-tmp(1:$-1)]
 res = [3x2 double]
   11.   4. 
   12.   5. 
   13.   23.
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: S. Gougeon