Package progs.lib

Examples of progs.lib.Point


public class RobotMovement {

  @Test
  public void tests() {
    Solution solution = new Solution();
    Assert.assertEquals(6, solution.numPaths(new Point(0, 0), new Point(2, 2)));
    Assert.assertEquals(10, solution.numPaths(new Point(0, 0), new Point(2, 3)));
  }
View Full Code Here


        return 1;
      }
      if (y.getX() < x.getX() || y.getY() < x.getY()) {
        return 0;
      }
      Point yXMinus1 = new Point(y.getX() - 1, y.getY());
      Point yYMinus1 = new Point(y.getX(), y.getY() - 1);
      int sum1, sum2;
      if (pointPathCount.containsKey(new Pair<>(x, yXMinus1))) {
        sum1 = pointPathCount.get(new Pair<>(x, yXMinus1));
      } else {
        sum1 = numPaths(x, yXMinus1);
View Full Code Here

TOP

Related Classes of progs.lib.Point

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.