Skip to content

Commit

Permalink
test aws
Browse files Browse the repository at this point in the history
  • Loading branch information
brendonmiranda committed Oct 12, 2024
1 parent ad44677 commit 34185ce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/aws/NumberOfSuitableLocations.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class NumberOfSuitableLocations {
/**
* // 2 * abs(x - center[i])
*/
public static int numberOfSuitableLocationsSearch(int[] center, int d) {
public int numberOfSuitableLocationsSearch(int[] center, int d) {

long low = -1000000000L;
long high = 1000000000L;
Expand Down
18 changes: 18 additions & 0 deletions src/test/java/aws/NumberOfSuitableLocationsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package aws;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class NumberOfSuitableLocationsTest {

@Test
public void test() {

NumberOfSuitableLocations numberOfSuitableLocations = new NumberOfSuitableLocations();
Assertions.assertEquals(3,numberOfSuitableLocations.numberOfSuitableLocationsSearch(new int[]{-2, 1, 0}, 8));
Assertions.assertEquals(5,numberOfSuitableLocations.numberOfSuitableLocationsSearch(new int[]{2, 0, 3, -4}, 22));
Assertions.assertEquals(0,numberOfSuitableLocations.numberOfSuitableLocationsSearch(new int[]{-3, 2, 2}, 8));

}

}

0 comments on commit 34185ce

Please sign in to comment.