I am still working on questions with low ranking ( < 1200 ). My submissions are far from perfect. The primary defect now is thinking of edge cases. In an attempt to be efficient, I make sure the code makes sense and the example test case passes. But I fail to think of many obvious cases that fail. For instance:
We are trying to cover a rectangular area with square tiles that cannot be cut but can extend beyond the borders. The math is easy, but there are many edge cases you have to think about.
- We will be multiplying. Can the size of the variable handle the new number?
- What if one of the numbers is a 1?
- Can any of the numbers be a zero?
- What if the size of 1 tile is smaller than the area to be covered?
I must learn to think about all the different combinations of input. I must also learn to take time and walk through the code with such test cases, and assure the answer is correct.