Cody

# Problem 42323. With apologies to William Blake

Solution 1849887

Submitted on 16 Jun 2019 by nag
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(symmetry(27),3))

yArray = 0 3 0

2   Pass
assert(isequal(symmetry(801),0))

yArray = 0 8 0 1

3   Pass
assert(isequal(symmetry(900),100))

yArray = 1 0 0 0

4   Pass
assert(isequal(symmetry(88887),1))

yArray = 0 8 8 8 8 8

5   Pass
assert(isequal(symmetry(1234567),65433))

yArray = 0 1 3 0 0 0 0 0

6   Pass
assert(isequal(symmetry(34567890),3432110))

yArray = 0 3 8 0 0 0 0 0 0

7   Pass
format long g x=ceil(1e9*rand); j=389e9+x assert(isequal(8e11-symmetry(j),j))

j = 389220702681 yArray = 0 8 0 0 0 0 0 0 0 0 0 0 0

8   Pass
format long g x=ceil(1e10*rand); j=889e10+x v=symmetry(j); assert(isequal(1e13-v,j))

j = 8892488713365 yArray = 1 0 0 0 0 0 0 0 0 0 0 0 0 0

9   Pass
x=2^40-1; assert(isequal(symmetry(symmetry(symmetry(symmetry(x)))),7775))

yArray = 0 1 1 0 0 0 0 0 0 0 0 0 0 0 yArray = 0 8 0 0 0 0 0 0 0 0 yArray = 0 3 1 1 8 0 0 0 0 0 yArray = 0 1 8 0 0 0 0

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!