I still don't understand the scoring system I guess.
Seems odd to me that the commented solution had size 43 ... but doing extra computation reduced this solution to size 33.
(unless JIT is at the level to implicitly convert?)
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
dx=[0,1,0,-1];
dy=[1,0,1,0];
x=1;
y=5;
assert(isequal(flyaway(dx,dy,x,y),true))
ans =
1
|
2 | Pass |
%%
dx=[0,1,0,-1];
dy=[1,0,1,0];
x=2;
y=5;
assert(isequal(flyaway(dx,dy,x,y),false))
ans =
0
|
3 | Pass |
%%
dx=[-2, 3, 1, 4, 0, 0, 1, 4];
dy=[-7,-5, 4, 6,-1, 4, 7, 1];
x=865;
y=711;
assert(isequal(flyaway(dx,dy,x,y),false))
ans =
0
|
4 | Pass |
%%
dx=[-2, 3, 1, 4, 0, 0, 1, 4];
dy=[-7,-5, 4, 6,-1, 4, 7, 1];
x=865;
y=710;
assert(isequal(flyaway(dx,dy,x,y),true))
ans =
1
|
5 | Pass |
%%
dx=[-1,-1,-1, 2,-1, 6];
dy=[-1,-2, 2, 1, 1,-6];
x=53;
y=-71;
assert(isequal(flyaway(dx,dy,x,y),true))
ans =
1
|
6 | Pass |
%%
dx=[-1,-1,-1, 2,-1, 6];
dy=[-1,-2, 2, 1, 1,-6];
x=50;
y=-75;
assert(isequal(flyaway(dx,dy,x,y),false))
ans =
0
|
Project Euler: Problem 1, Multiples of 3 and 5
1064 Solvers
Project Euler: Problem 16, Sums of Digits of Powers of Two
61 Solvers
Back to basics 19 - character types
189 Solvers
104 Solvers
Sum the numbers on the main diagonal
375 Solvers