Skip to content

dusanbakurski/codefair-2024

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Vega IT x Codefair 2024

Welcome to the Vega IT challenge for Codefair 2024. By solving it, you can win a place at our software developer workshop (and other cool things), where you will work with experienced developers to enhance your engineering skills.

Rules

  • Submit your solution before the deadline mentioned in the email.
  • Submit it by forking this repository, solving the challenge, and opening a PR to this repository, assigning @kostakupresak as the reviewer.
  • Use any programming language to solve this challenge.

Happy programming!

Challenge

Yesterday, a heavy rainstorm swept across Serbia, submerging almost all roads. This was particularly noticeable in Serbian villages, where dirt roads turned into muddy paths. The rain poured for hours, forming large puddles that stayed for days. Children in the villages, drawn to the puddles, began to wonder how they could calculate the water these puddles held. That's where they need your help.

In the following two examples, we are representing two puddles with squares. Black squares represent the road, blue squares represent water, and white squares represent empty space.

Example A

This is how puddle A looks without water.

Empty puddle A

This is how puddle A looks with water.

Empty puddle A

This puddle can hold 8 squares of water without the water spilling over.

Example B

This is how puddle B looks without water.

Empty puddle B

This is how puddle B looks with water.

Empty puddle B

This puddle can hold 16 squares of water without the water spilling over.

Can you write an algorithm that can calculate how many squares of water a puddle can hold based on the given structure?

About

Vega IT challenge for Codefair 2024

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%