How to do simulation to verify Randomly draw balls into boxes problem?

This reads like homework
FAQ: Homework Policy

At the core of your solution would probably be the base::sample() function which can randomly sample 'size' number of objects from a set passed in as 'x'

sample(x=letters[1:26],size=5,replace=TRUE)