task08.task0814 - Greater than 10? You're not a good fit for us
When I run it has removed elements > 10. But not according to codegym vaerify?
package com.codegym.task.task08.task0814;
import java.util.HashSet;
import java.util.Set;
/*
Greater than 10? You're not a good fit for us
*/
public class Solution {
public static HashSet<Integer> createSet() {
// write your code here
Set<Integer> set = new HashSet<Integer>();
for (int i=0; i< 20; i++){
set.add(i);
}
return (HashSet)set;
}
public static HashSet<Integer> removeAllNumbersGreaterThan10(HashSet<Integer> set) {
// write your code here
for(int i= 0; i< 20; i++){
if (i>10 && set.contains(i)){
set.remove(i);
}
}
return set;
}
public static void main(String[] args) {
removeAllNumbersGreaterThan10(createSet());
}
}