Cody

# Problem 2848. Digital Neighbourhood

Solution 2015531

Submitted on 12 Nov 2019
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   Fail
x = 132; y_correct = 123; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

2   Fail
x = 182; y_correct = 218; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

3   Fail
x = 172; y_correct = [127; 217]; % there are two such numbers, one of them is enough, but you can return both y = sort(find_neighbour(x)); fprintf('%d founded.\n',y) y = y(:); assert(any(y_correct==y))

172 founded.

Assertion failed.

4   Fail
x = 1; y_correct = 10; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

5   Fail
x = 10; y_correct = 1; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

6   Fail
x = 100; y_correct = 10; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

7   Fail
x = 99; y_correct = 909; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

8   Fail
x = 199; y_correct = 919; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

9   Fail
x = 1099; y_correct = 991; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

10   Fail
x = 123455; y_correct = 123545; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

11   Fail
x = 56565656; y_correct = 56565665; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

12   Fail
x = 8761199; y_correct = 8761919; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

13   Fail
x = 820199; y_correct = 819920; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

14   Fail
x = 991; y_correct = 919; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

15   Fail
x = 911; y_correct = 1019; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

16   Fail
x = 7001; y_correct = 7010; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

17   Fail
x = 1192999; y_correct = 1199299; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

18   Fail
x = 8713222; y_correct = 8712322; assert(isequal(find_neighbour(x),y_correct))

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!