LatticePaths.java 501 B

12345678910111213141516171819202122
  1. /* Starting in the top-left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom-right corner.
  2. How many such routes are there through a 20×20 grid?
  3. */
  4. public class LatticePaths {
  5. private String[] grid = new String[2];
  6. private int numRoutes;
  7. public LatticePaths(int num) {
  8. this.grid = {};
  9. }
  10. public int getNumRoutes() {
  11. return this.numRoutes;
  12. }
  13. public void setNumRoutes(int num) {
  14. this.numRoutes = num;
  15. }
  16. }