Very interesting solution, now I got a way to use "array index + array value positive/negative" to build hashMap when all input values are positive or negative!

use swap to put nums[i] to position i - 1, for example put 1 to position 0.
using a while in case the new nums[i] is not i - 1, continue put it to right location.
check nums[nums[i] - 1] != nums[i] in case they are same number falling to forever loop.
public int firstMissingPositive(int[] nums) {
for(int i = 0; i < nums.length; i++){
while(nums[i] > 0 && nums[i] - 1 < nums.length && nums[i] - 1 != i && nums[nums[i]-1] != nums[i]){
swap(nums, i, nums[i] - 1);
}
}
int i = 0;
for(; i < nums.length; i++){
if(i + 1 != nums[i]) break;
}
return i + 1;
}
void swap(int[] nums, int i, int j){
int t = nums[i];
nums[i] = nums[j];
nums[j] = t;
}

@SM54 not sure you still need my answer but one of the examples would be the type of tasks which works with grids (int[][]) and traverses them. If you need to keep the visited cells one option is to have boolean[][] array which would take n*m memory. Instead of it you can use Set<Integer> and encode the coordinates in it during write and check. See "Spiral Matrix" task as the example
Another example is https://discuss.leetcode.com/topic/50837/the-most-concise-java-solution-possible-beats-99-with-explanation - I used this idea to encode number positions into the array before sorting, thus I used O(1) memory to solve the problem