The expression return array_search(max($map), $map, true) could return the type string which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
17
}
18
19
public static function findDuplicate2(array $nums): int
The expression return array_search(max($map), $map, true) could return the type string which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
30
}
31
32
public static function findDuplicate3(array $nums): int