Cody

# Problem 242. Make a function that returns its own character count

Solution 194057

Submitted on 20 Jan 2013 by Alfonso Nieto-Castanon
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
fname = 'omphaloskeptic.m'; fid = fopen(fname); file = textscan(fid,'%c', ... 'CommentStyle','%', ... 'Whitespace',''); fclose(fid); ha = histc(file{1},1:128); hp = omphaloskeptic; assert(~any(ismember(33:41,find(ha))),'Used an illegal character'); assert(isequal(ha,hp),'Actual characters did not match prediction');

ans = X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X \ X X X X X X X X X X X X Y X X X X X X X X X X Z X X X X Y X X X X X X X X X X X X X X X X X X X X X X X X X X ÃÂ¼ c [ ] \ Z Y X X \ X [ Y [ Y X Y Z X Y Y Y ^ \ [ X Y ] [ Y X X X X X X X X X X X ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 11 3 5 4 2 1 0 0 4 0 3 1 3 1 0 1 2 0 1 1 1 6 4 3 0 1 5 3 1 0 0 0 0 0 0 0 0 0 0 0