NucuLabs.dev

Share this post

Overflowing Buckets

nuculabs.dev

Discover more from NucuLabs.dev

Programming, Cloud and Engineering! 👨‍🔬
Continue reading
Sign in

Overflowing Buckets

Denis Nuțiu
Jun 15, 2023
Share this post

Overflowing Buckets

nuculabs.dev
Share

Hello everyone 👋,

Today I want to share with you a problem I’ve encountered along my journey.

The problem is fairly simple:

  • You have a finite number of water units.

  • You have a finite number of buckets.

  • You need to distribute the water units into buckets.

  • Each bucket has a maximum capacity.

  • When a bucket is full, the water overflows into the next two buckets by splitting evenly.

  • You need to print the number of buckets that are full.

Read the full post on my blog!

Share this post

Overflowing Buckets

nuculabs.dev
Share
Previous
Next
Comments
Top
New

No posts

Ready for more?

© 2023 NucuLabs.dev
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing