Cody

# Problem 1162. Happy 2013...

Solution 232744

Submitted on 19 Apr 2013
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
!cp diff_digits.m safe !rm *.* !mv safe diff_digits.m % Clean user's function from some known jailbreaking mechanisms fid = fopen('diff_digits.m'); st = regexprep(char(fread(fid)'), '!', 'error(''No shell commands!''); %'); st = regexprep(st, 'feval', 'error(''No fancy functions!''); %'); st = regexprep(st, 'str2func', 'error(''No fancy functions!''); %'); st = regexprep(st, 'regex', 'error(''No fancy functions!''); %'); st = regexprep(st, 'system', 'error(''No shell commands!''); %'); st = regexprep(st, 'dos', 'error(''No shell commands!''); %'); st = regexprep(st, 'unix', 'error(''No shell commands!''); %'); st = regexprep(st, 'perl', 'error(''No external languages commands!''); %'); st = regexprep(st, 'java', 'error(''No external languages commands!''); %'); st = regexprep(st, 'assert', 'error(''No overwriting!''); %'); fclose(fid) fid = fopen('diff_digits.m' , 'w'); fwrite(fid,st); fclose(fid)

``` ans = 0 ans = 0 ```

2   Fail
%% start=1000; finish=1023; y_correct = 1; assert(isequal(diff_digits(start,finish),y_correct))

```Error: Output argument "temp" (and maybe others) not assigned during call to "/users/msssystem4/diff_digits.m>diff_digits". ```

3   Fail
%% start=1000; finish=9999; y_correct = 4536; assert(isequal(diff_digits(start,finish),y_correct))

```Error: Output argument "temp" (and maybe others) not assigned during call to "/users/msssystem4/diff_digits.m>diff_digits". ```

4   Fail
%% start=1234; finish=5678; y_correct = 2273; assert(isequal(diff_digits(start,finish),y_correct))

```Error: Output argument "temp" (and maybe others) not assigned during call to "/users/msssystem4/diff_digits.m>diff_digits". ```

5   Fail
%% assert(isequal(diff_digits(4321,6789),1210))

```Error: Output argument "temp" (and maybe others) not assigned during call to "/users/msssystem4/diff_digits.m>diff_digits". ```

6   Fail
%% assert(isequal(diff_digits(1988,2012),0))

```Error: Output argument "temp" (and maybe others) not assigned during call to "/users/msssystem4/diff_digits.m>diff_digits". ```