Skip to content

Commit

Permalink
Adding solution
Browse files Browse the repository at this point in the history
  • Loading branch information
josdem committed Apr 10, 2024
2 parents 1c4ad40 + d40abcb commit 9564c6f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion simple-algorithms/counting-numbers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
}

def junitJupiterVersion = '5.7.0'
def junitJupiterVersion = '5.10.2'

group 'com.josdem.kata'
version '1.0-SNAPSHOT'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file modified simple-algorithms/counting-numbers/gradlew
100644 → 100755
Empty file.
Empty file modified simple-algorithms/counting-numbers/gradlew.bat
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import java.util.Arrays;
import java.util.List;

public class NumbersCounter {

public List<Integer> count(List<Integer> numbers) {
return Arrays.asList((int) numbers.stream().filter(n -> n > 0).count(), (int) numbers.stream().filter(n -> n < 0).count(), (int) numbers.stream().filter(n -> n == 0).count());
return Arrays.asList(
(int) numbers.stream().filter(n -> n > 0).count(),
(int) numbers.stream().filter(n -> n < 0).count(),
(int) numbers.stream().filter(n -> n == 0).count());
}
}

0 comments on commit 9564c6f

Please sign in to comment.