The index checking cannot be removed from four sum problem solution.