Skip to content

Commit

Permalink
1431
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Jan 27, 2022
1 parent dccae48 commit 4a25131
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions E_1431_KidsWiththeGreatestNumberofCandies.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class Solution {
public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
List<Boolean> donen = new ArrayList<>();
int max=0;
for(int i=0;i<candies.length; i++){
if(candies[i]>max)
max=candies[i];
}
for(int i=0;i<candies.length; i++) {
if(candies[i]+extraCandies>=max)
donen.add(true);
else
donen.add(false);
}
return donen;
}
}

0 comments on commit 4a25131

Please sign in to comment.