Skip to content

Commit

Permalink
jumper passes 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim L authored and Tim L committed Jul 8, 2024
1 parent d266c7a commit 38b7b90
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class RockPaperSissorsEvaluator {
* @return the respective winning move
*/
public String getWinningMove(String handSign) {

return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ public class MultiplesDeleter {
* given an array of integers, named `ints` return an identical array with evens removed
*/
public Integer[] deleteEvens(Integer[] ints) {
// int a = 0;
// for(int i = 0; i < ints.length; i++){
// if (ints[i] % 2 != 0){
// a++;
// }
// }
// int[] result = new int[a];
// int count = 0;
// for (int i = 0; i < ints.length; i++){
// if (ints[i] % 2 != 0){
// result[count] = ints[i];
// count++;
// }
// }
// return result;
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Cat extends Pet {
* @param age age of this Cat
*/
public Cat(String name, Integer age) {

Cat cat = new Cat("", 5);
}

/**
Expand Down Expand Up @@ -38,6 +38,7 @@ public Cat() {
* @return meow as a string
*/
public String speak() {
return null;

return "Meow";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public Pet() {
* @param name name of this pet
*/
public Pet(String name) {

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ public class Jumper {
* Complete the function below.
*/
public int jumps(int k, int j) {
return -1;

// int jumps= k / j;
// int jums =+ k % j;
// return jumps;

int numOfJumps = k / j;
int heightRemaining = k % j;

if (heightRemaining > 0){
return numOfJumps +1;
}else return numOfJumps;
}
}

0 comments on commit 38b7b90

Please sign in to comment.