Cody

# Problem 1098. USC Fall 2012 ACM : Code Word Minimum Flipped Bits

Solution 1569991

Submitted on 27 Jun 2018 by J. S. Kowontan
• Size: 16
• This is the leading solution.
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
tic urlfn='http://contest.usc.edu/index.php/Fall12/Home?action=download&upname=codes.in.txt'; urlwrite(urlfn,'codesin_A.txt'); % Load file from USC toc

Elapsed time is 0.904127 seconds.

2   Pass
flip_correct=[1 0 0 54 1 29 37 32 33 32 39 8 0 0 36 36 35]; fid=fopen('codesin_A.txt','r'); qty=fscanf(fid,'%i',1); for ptr=1:qty nr=fscanf(fid,'%i',1); nc=fscanf(fid,'%i',1); A=zeros(nr,nc); for i=1:nr strv=fscanf(fid,'%s',1); % Reads a line of text A(i,:)=strv-'0'; % vectorize the string end strv=fscanf(fid,'%s',1); v=strv-'0'; USC_flips = USC_No_1(A,v); assert(isequal(USC_flips,flip_correct(ptr))) end fclose(fid); toc

ans = 1 ans = 0 ans = 0 ans = 54 ans = 1 ans = 29 ans = 37 ans = 32 ans = 33 ans = 32 ans = 39 ans = 8 ans = 0 ans = 0 ans = 36 ans = 36 ans = 35 Elapsed time is 1.150718 seconds.