Cody

# Problem 2264. GJam 2011 Africa Qualifier C: House, maximum area rectangle

Solution 564717

Submitted on 24 Jan 2015 by Paul Berglund
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
%% nc=1; str='G'; Aexp=1; A=House(reshape(str,nc,[])'); assert(isequal(Aexp,A))

2   Pass
%% nc=2; str='GSSG'; Aexp=4; A=House(reshape(str,nc,[])'); assert(isequal(Aexp,A))

3   Pass
%% nc=2; str='GTGG'; Aexp=2; A=House(reshape(str,nc,[])'); assert(isequal(Aexp,A))

4   Pass
%% nc=5; str='GGTGGTGGGGGSSGTGGGGGRWTRTRTWWTWTWRR'; Aexp=9; A=House(reshape(str,nc,[])'); assert(isequal(Aexp,A))

5   Pass
%% nc=48; str='SSGSGSSGGGWSSSGSGGGGGGSGGSGSSGGSGGGSSSSGSSSSSSGSGSSSSGSGGSGSSSGGGGGGSGSGSGSSSSSSSSGGGGGSGGGSGSSSSGGSGSSGSGSSGSSSGSGGGSGSSSGSSGGGGSGSSSSSSGGGSGGGGGGSGSGSSSSGGGSSSGGGGGSGSSSGSGSSGSGGSSSSSSGGSSGGGSGSGGGGSSGGGGSSSSSSGGSGGSGGSGSGGSSGGGGSRGSGGSGSSSSSGSGGSSSSGSGGSSSSGSSSGSGGSSGGGGSSGSSGSSGGSGGSSGSSGSGSGGSGSGGSGGGGGGGGGSGGSGSSSSSGSSSGGGSSSGSSGSGSSGGSGSSGGSGGSGSSSGSGGGSGSSSSSGGSGGGGGGGSSGGSSSSSGGGGSGSSSGGGSSGSGSGGGGGSSSGGSGGGGSSSGGGGGSGSSSSSGGSGSSSTGGSSSSSSSSSGSGRGGSSSGSGGSSGSSGGGSSGGGGGGSGGGSGGSGGGGSGSSSGSGGSSSGGGSGSGSGGGGSSSGGGSSSGSSSGGGGGGGSGSGSSSSSGSSGGSGGSGSGGSGSSGGGSGSSGSSGSSSSGSGGGGGSGGGSGSGSSSSGGSSGGSSGGSSGGGGSSGG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