not extract the same thing continuously from an array

Asked 2 years ago, Updated 2 years ago, 81 views

What technique should I use to randomly extract one element of an array and not sequentially extract the same element?

The parts that are taken out at random are made.
I'm sorry it's rough
Please let me know

perl

2022-09-30 12:06

1 Answers

1) Remove selected elements using splice.
2) Replace the selected element with the last element to reduce the selection range by one without pop or pop


2022-09-30 12:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.