I generate a map whose keys consist of numbers.
Since the user can delete individual keys and later add a new object, I want to find out which number is the next free key.
So if the map looks like this:
0=Object 0
1=Object 1
3=Object 3
4=Object 4
My function should return the value 2 as a free key.
My attempts didn't go as planned until now. Therefore I contact the community. maybe someone can help me.
thanks
Since the user can delete individual keys and later add a new object, I want to find out which number is the next free key.
So if the map looks like this:
0=Object 0
1=Object 1
3=Object 3
4=Object 4
My function should return the value 2 as a free key.
My attempts didn't go as planned until now. Therefore I contact the community. maybe someone can help me.
thanks