4 ms·
Author fails to follow own advice: int printFirstNPositive(int maxToPrint, Collection<Integer> c) The method name uses "N", but the param for N is named "ma
by eevilspock 10y ago
Author fails to follow own advice:
int printFirstNPositive(int maxToPrint, Collection<Integer> c)
The method name uses "N", but the param for N is named "maxToPrint". Confusing and also violates his/her wasted space rule.
Instead:
int printFirstNPositive(int n, Collection<Integer> c)
I think the short variable names "n" and "c" are fine since they are part of the method signature and have unambiguous meaning, and also because the implementation is so short (so no problem remembering that n and c are the inputs.