I ran it and got the right output.
What did I do wrong?
package com.codegym.task.task08.task0814;
import java.util.HashSet;
import java.util.Iterator;
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
HashSet<Integer> integerHashSet = new HashSet<Integer>();
for (int i = 0; i < 20; i++) {
integerHashSet.add(i);
}
return integerHashSet;
}
public static HashSet<Integer> removeAllNumbersGreaterThan10(HashSet<Integer> set) {
// write your code here
int i = 0;
while (i < 20) {
if (i > 10 && set.contains(i)) {
set.remove(i);
i -= 1;
} else {
i++;
}
}
return set;
}
public static void main(String[] args) {
}
}