Changed the input to subrequirements and parents to Integer and not int. If it is not integer, than array.remove(val) tries to remove at the index, not the integer. Important