Cody

Problem 42291. GJam 2015 Rd1B: Counter Culture

Solution 2525552

Submitted on 12 Jun 2020
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
N=1; L=Counter_Culture(N); Lexp=1; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test1 (line 2) L=Counter_Culture(N);

2   Fail
N=19; L=Counter_Culture(N); Lexp=19; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test2 (line 2) L=Counter_Culture(N);

3   Fail
N=23; L=Counter_Culture(N); Lexp=15; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test3 (line 2) L=Counter_Culture(N);

4   Fail
N=1101; L=Counter_Culture(N); Lexp=150; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test4 (line 2) L=Counter_Culture(N);

5   Fail
N=998999; L=Counter_Culture(N); Lexp=3334; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test5 (line 2) L=Counter_Culture(N);

6   Fail
N=990000; L=Counter_Culture(N); Lexp=3425; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test6 (line 2) L=Counter_Culture(N);

7   Fail
N=10110; L=Counter_Culture(N); Lexp=447; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test7 (line 2) L=Counter_Culture(N);

8   Fail
N=11111; L=Counter_Culture(N); Lexp=459; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test8 (line 2) L=Counter_Culture(N);

9   Fail
N=999991; L=Counter_Culture(N); Lexp=3426; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test9 (line 2) L=Counter_Culture(N);

10   Fail
N=512; L=Counter_Culture(N); Lexp=46; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test10 (line 2) L=Counter_Culture(N);

11   Fail
N=999899; L=Counter_Culture(N); Lexp=3334; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test11 (line 2) L=Counter_Culture(N);

12   Fail
N=1999; L=Counter_Culture(N); Lexp=328; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test12 (line 2) L=Counter_Culture(N);

13   Fail
N=11101; L=Counter_Culture(N); Lexp=449; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test13 (line 2) L=Counter_Culture(N);

14   Fail
N=876543; L=Counter_Culture(N); Lexp=2657; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test14 (line 2) L=Counter_Culture(N);

15   Fail
N=4; L=Counter_Culture(N); Lexp=4; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test15 (line 2) L=Counter_Culture(N);

16   Fail
N=102; L=Counter_Culture(N); Lexp=31; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test16 (line 2) L=Counter_Culture(N);

17   Fail
N=11000; L=Counter_Culture(N); Lexp=1337; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test17 (line 2) L=Counter_Culture(N);

18   Fail
N=1998; L=Counter_Culture(N); Lexp=327; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test18 (line 2) L=Counter_Culture(N);

19   Fail
N=900000; L=Counter_Culture(N); Lexp=3434; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test19 (line 2) L=Counter_Culture(N);

20   Fail
N=131072; L=Counter_Culture(N); Lexp=1639; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test20 (line 2) L=Counter_Culture(N);

21   Fail
N=524288; L=Counter_Culture(N); Lexp=2149; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test21 (line 2) L=Counter_Culture(N);

22   Fail
N=20; L=Counter_Culture(N); Lexp=20; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test22 (line 2) L=Counter_Culture(N);

23   Fail
N=789012; L=Counter_Culture(N); Lexp=2435; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test23 (line 2) L=Counter_Culture(N);

24   Fail
N=200; L=Counter_Culture(N); Lexp=129; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test24 (line 2) L=Counter_Culture(N);

25   Fail
N=109876; L=Counter_Culture(N); Lexp=3213; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test25 (line 2) L=Counter_Culture(N);

26   Fail
N=11100; L=Counter_Culture(N); Lexp=448; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test26 (line 2) L=Counter_Culture(N);

27   Fail
N=262144; L=Counter_Culture(N); Lexp=1842; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test27 (line 2) L=Counter_Culture(N);

28   Fail
N=11; L=Counter_Culture(N); Lexp=11; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test28 (line 2) L=Counter_Culture(N);

29   Fail
N=1001; L=Counter_Culture(N); Lexp=139; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test29 (line 2) L=Counter_Culture(N);

30   Fail
N=987654; L=Counter_Culture(N); Lexp=2879; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test30 (line 2) L=Counter_Culture(N);

31   Fail
N=999989; L=Counter_Culture(N); Lexp=3424; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test31 (line 2) L=Counter_Culture(N);

32   Fail
N=11011; L=Counter_Culture(N); Lexp=359; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test32 (line 2) L=Counter_Culture(N);

33   Fail
N=4096; L=Counter_Culture(N); Lexp=238; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test33 (line 2) L=Counter_Culture(N);

34   Fail
N=900001; L=Counter_Culture(N); Lexp=1446; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test34 (line 2) L=Counter_Culture(N);

35   Fail
N=201; L=Counter_Culture(N); Lexp=32; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test35 (line 2) L=Counter_Culture(N);

36   Fail
N=99001; L=Counter_Culture(N); Lexp=437; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test36 (line 2) L=Counter_Culture(N);

37   Fail
N=999999; L=Counter_Culture(N); Lexp=3434; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test37 (line 2) L=Counter_Culture(N);

38   Fail
N=999900; L=Counter_Culture(N); Lexp=3335; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test38 (line 2) L=Counter_Culture(N);

39   Fail
N=901; L=Counter_Culture(N); Lexp=39; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test39 (line 2) L=Counter_Culture(N);

40   Fail
N=2201; L=Counter_Culture(N); Lexp=161; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test40 (line 2) L=Counter_Culture(N);

41   Fail
N=90; L=Counter_Culture(N); Lexp=28; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test41 (line 2) L=Counter_Culture(N);

42   Fail
N=101; L=Counter_Culture(N); Lexp=30; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test42 (line 2) L=Counter_Culture(N);

43   Fail
N=10111; L=Counter_Culture(N); Lexp=448; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test43 (line 2) L=Counter_Culture(N);

44   Fail
N=31; L=Counter_Culture(N); Lexp=14; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test44 (line 2) L=Counter_Culture(N);

45   Fail
N=10; L=Counter_Culture(N); Lexp=10; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test45 (line 2) L=Counter_Culture(N);

46   Fail
N=10100; L=Counter_Culture(N); Lexp=437; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test46 (line 2) L=Counter_Culture(N);

47   Fail
N=999998; L=Counter_Culture(N); Lexp=3433; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test47 (line 2) L=Counter_Culture(N);

48   Fail
N=999000; L=Counter_Culture(N); Lexp=3335; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test48 (line 2) L=Counter_Culture(N);

49   Fail
N=990001; L=Counter_Culture(N); Lexp=1536; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test49 (line 2) L=Counter_Culture(N);

50   Fail
N=30; L=Counter_Culture(N); Lexp=22; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test50 (line 2) L=Counter_Culture(N);

51   Fail
N=900; L=Counter_Culture(N); Lexp=137; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test51 (line 2) L=Counter_Culture(N);

52   Fail
N=101001; L=Counter_Culture(N); Lexp=1538; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test52 (line 2) L=Counter_Culture(N);

53   Fail
N=999990; L=Counter_Culture(N); Lexp=3425; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test53 (line 2) L=Counter_Culture(N);

54   Fail
N=989999; L=Counter_Culture(N); Lexp=3424; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test54 (line 2) L=Counter_Culture(N);

55   Fail
N=21; L=Counter_Culture(N); Lexp=13; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test55 (line 2) L=Counter_Culture(N);

56   Fail
N=9999; L=Counter_Culture(N); Lexp=336; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test56 (line 2) L=Counter_Culture(N);

57   Fail
N=100001; L=Counter_Culture(N); Lexp=1437; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test57 (line 2) L=Counter_Culture(N);

58   Fail
N=10999; L=Counter_Culture(N); Lexp=1336; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test58 (line 2) L=Counter_Culture(N);

59   Fail
N=100; L=Counter_Culture(N); Lexp=29; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test59 (line 2) L=Counter_Culture(N);

60   Fail
N=91; L=Counter_Culture(N); Lexp=20; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test60 (line 2) L=Counter_Culture(N);

61   Fail
N=11010; L=Counter_Culture(N); Lexp=358; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test61 (line 2) L=Counter_Culture(N);

62   Fail
N=29; L=Counter_Culture(N); Lexp=21; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test62 (line 2) L=Counter_Culture(N);

63   Fail
N=2001; L=Counter_Culture(N); Lexp=141; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test63 (line 2) L=Counter_Culture(N);

64   Fail
N=11110; L=Counter_Culture(N); Lexp=458; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test64 (line 2) L=Counter_Culture(N);

65   Fail
N=10001; L=Counter_Culture(N); Lexp=338; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test65 (line 2) L=Counter_Culture(N);

66   Fail
N=9; L=Counter_Culture(N); Lexp=9; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test66 (line 2) L=Counter_Culture(N);

67   Fail
N=101000; L=Counter_Culture(N); Lexp=2436; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test67 (line 2) L=Counter_Culture(N);

68   Fail
N=1000; L=Counter_Culture(N); Lexp=138; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test68 (line 2) L=Counter_Culture(N);

69   Fail
N=19; L=Counter_Culture(N); Lexp=19; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test69 (line 2) L=Counter_Culture(N);

70   Fail
N=12000; L=Counter_Culture(N); Lexp=1348; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test70 (line 2) L=Counter_Culture(N);

71   Fail
N=999; L=Counter_Culture(N); Lexp=137; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test71 (line 2) L=Counter_Culture(N);

72   Fail
N=22; L=Counter_Culture(N); Lexp=14; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test72 (line 2) L=Counter_Culture(N);

73   Fail
N=1111; L=Counter_Culture(N); Lexp=160; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test73 (line 2) L=Counter_Culture(N);

74   Fail
N=12001; L=Counter_Culture(N); Lexp=359; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test74 (line 2) L=Counter_Culture(N);

75   Fail
N=12; L=Counter_Culture(N); Lexp=12; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test75 (line 2) L=Counter_Culture(N);

76   Fail
N=99000; L=Counter_Culture(N); Lexp=1426; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test76 (line 2) L=Counter_Culture(N);

77   Fail
N=999001; L=Counter_Culture(N); Lexp=2436; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test77 (line 2) L=Counter_Culture(N);

78   Fail
N=899999; L=Counter_Culture(N); Lexp=3433; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test78 (line 2) L=Counter_Culture(N);

79   Fail
N=10010; L=Counter_Culture(N); Lexp=347; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test79 (line 2) L=Counter_Culture(N);

80   Fail
N=10000; L=Counter_Culture(N); Lexp=337; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test80 (line 2) L=Counter_Culture(N);

81   Fail
N=10101; L=Counter_Culture(N); Lexp=438; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test81 (line 2) L=Counter_Culture(N);

82   Fail
N=2000; L=Counter_Culture(N); Lexp=329; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test82 (line 2) L=Counter_Culture(N);

83   Fail
N=111; L=Counter_Culture(N); Lexp=40; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test83 (line 2) L=Counter_Culture(N);

84   Fail
N=999901; L=Counter_Culture(N); Lexp=3336; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test84 (line 2) L=Counter_Culture(N);

85   Fail
N=2101; L=Counter_Culture(N); Lexp=151; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test85 (line 2) L=Counter_Culture(N);

86   Fail
N=10011; L=Counter_Culture(N); Lexp=348; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test86 (line 2) L=Counter_Culture(N);

87   Fail
N=2002; L=Counter_Culture(N); Lexp=142; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test87 (line 2) L=Counter_Culture(N);

88   Fail
N=32; L=Counter_Culture(N); Lexp=15; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test88 (line 2) L=Counter_Culture(N);

89   Fail
N=110; L=Counter_Culture(N); Lexp=39; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test89 (line 2) L=Counter_Culture(N);

90   Fail
N=2100; L=Counter_Culture(N); Lexp=240; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test90 (line 2) L=Counter_Culture(N);

91   Fail
N=11001; L=Counter_Culture(N); Lexp=349; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test91 (line 2) L=Counter_Culture(N);

92   Fail
N=99; L=Counter_Culture(N); Lexp=28; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test92 (line 2) L=Counter_Culture(N);

93   Fail
N=1100; L=Counter_Culture(N); Lexp=238; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test93 (line 2) L=Counter_Culture(N);

94   Fail
N=1099; L=Counter_Culture(N); Lexp=237; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test94 (line 2) L=Counter_Culture(N);

95   Fail
N=1000000; L=Counter_Culture(N); Lexp=3435; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test95 (line 2) L=Counter_Culture(N);

96   Fail
N=100000; L=Counter_Culture(N); Lexp=1436; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test96 (line 2) L=Counter_Culture(N);

97   Fail
N=2200; L=Counter_Culture(N); Lexp=250; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test97 (line 2) L=Counter_Culture(N);

98   Fail
N=1110; L=Counter_Culture(N); Lexp=159; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test98 (line 2) L=Counter_Culture(N);

99   Fail
N=432109; L=Counter_Culture(N); Lexp=1779; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test99 (line 2) L=Counter_Culture(N);

100   Fail
N=199; L=Counter_Culture(N); Lexp=128; assert(isequal(Lexp,L))

Undefined function 'Counter_Culture' for input arguments of type 'double'. Error in Test100 (line 2) L=Counter_Culture(N);

101   Pass
toc

Elapsed time is 4.277878 seconds.

102   Pass
% function GJam_Rd1B_2015a % % % fn='A-small-practice.in'; % [data] = read_file(fn); % % % fidG = fopen('A-small-practice.out', 'w'); % % tic % for i=1:size(data,2) % Cell array has J cols of cases % L = Counter_Culture(data{i}); % fprintf(fidG,'Case #%i: %i\n',i,L); % fprintf('Case #%i: %i\n',i,L); % end % toc % fclose(fidG); % end % % function depth=Counter_Culture(v) % % create all paths % persistent m mv maxdepth % if isempty(m) % % mv=zeros(1000000,1); % m{1000000}=[]; % set cell array size to max possible % for i=1:9 % m{i}=i; % mv(i)=i; % place best depth into mv for repeated searches % end % maxdepth=9; % end % % if mv(v) % usage of persistent data % depth=mv(v); % return; % end % % % while 1 % mset=m{maxdepth}; % start with last set calculated % maxdepth=maxdepth+1; % msetn=mset+1; % % msetn=msetn(mv(msetn)==0); % mv(msetn)=maxdepth; % % for i=1:length(mset) % flipv=calc_flip(mset(i)); % if mv(flipv)==0 % new value % mv(flipv)=maxdepth; % msetn=[msetn flipv]; % add to list % end % end % % m{maxdepth}=msetn; % % if any(msetn==v) % depth=maxdepth; % return % end % % end % while % % end % % function vr=calc_flip(val) % vr=0; % while val % v1=mod(val,10); % vr=10*vr+v1; % val=(val-v1)/10; % end % end % % function [d] = read_file(fn) % d={}; % fid=fopen(fn); % fgetl(fid); % Total Count ignore % ptr=0; % while ~feof(fid) % ptr=ptr+1; % v=str2num(fgetl(fid)); % d{ptr}=v; % end % feof % fclose(fid); % end % read_file

103   Pass
toc

Elapsed time is 4.318864 seconds.