Winner Imre Polik (Shame n)

Finish 2003-11-11 13:00:00 UTC

test_13

by Stijn Helsen

Status: Passed
Results: pass
CPU Time: 2.223
Score: 126.0
Submitted at: 2003-11-04 14:16:02 UTC
Scored at: 2003-11-04 15:56:55 UTC

Current Rank: 147th
Based on: test_1 (diff)
Basis for: test_16 (diff)

Comments
Stijn Helsen
04 Nov 2003
not short at all, but less loops (for the good old non-JIT Matlab).....
Please login or create a profile.
Code
n=length(a);
for i=1:n;
 k=0:i-1;
 l=(1:n-i)';
 A=a(k(ones(n-i,1),:)+l(:,ones(i,1)));
 j=find(all(A==fliplr(A),2));
 if ~isempty(j)
  b=A(j,:);
 end
end