Find the Duplicates

You’ll find multiple reasons to remove duplicates from a series of random numbers. The main reason is that the process or generating random numbers is capable of yielding duplicate values. But more importantly, if your list represents discrete items in the real world, such as playing cards, you can’t really have a duplicate value pop up.
Continue reading

Shuffle That Playlist

Recently, I created a playlist of songs on a certain online subscription service. I chose to shuffle the tunes, but found that one song in particular played more often than the others. My immediate thought was, “Why can’t the programmers design a shuffled playlist that doesn’t overplay the same song”? Rather than email the programmers, I thought I’d present the puzzle as this month’s Exercise.
Continue reading