4 ms·
If you're worried about being able to make an array where a.length == int.max, (which is reasonable in an algorithm which does any math on the length), replace
by joshka 2y ago
If you're worried about being able to make an array where a.length == int.max, (which is reasonable in an algorithm which does any math on the length), replace the array with another substitute which you can mock the size of (e.g. in Java that would be possible against an ArrayList). You can test the algorithm separately from the execution of the algorithm.