Efficient algorithm to find first available name

前端 未结 7 1339
野性不改
野性不改 2021-01-19 03:26

I have an array containing names of items. I want to give the user the option to create items without specifying their name, so my program will have to supply a unique defau

相关标签:
7条回答
  • 2021-01-19 04:17

    Why not just keep track of the maximum number to date, and when you need a new one, increment it?

    0 讨论(0)
提交回复
热议问题