Remove unused variables.
Fix potential bug.
Add Maximal Rectangle solution.