Skip to content

AZZB/interview-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pleo Challenge

We want you to create a user interface using any framework of your choise that solves the following problem.

The problem

You are given a vector of heights, these heights form a structure like shown in the following figure.

Figure 1

Vector : [2, 5, 1, 3, 1, 2, 1, 7, 7, 6]

It is raining over the structure. The water in one cell always flows to the neighboring cell of least height if it is not already occupied by water or a block. A sink is a cell with the property that water never flows away from it. All the neighboring cells that drains into a sink are said to form a basin.

Figure 2

Observe that the structure is thereby partitioned into basins. Determine the number of unit of water contained in all basins. In the example the input for this program is [2, 5, 1, 3, 1, 2, 1, 7, 7, 6] and it should output 17

The objective

The goal is to create the most optimal algorithm that given any array will output the correct units of water. Make a user interface to enter the values and visualize the solution.

Instructions

Please fork this repo and make your solution there so we can track your solution. We want to see your progression through commits (so don’t commit the entire solution in 1 commit), edit the README.md explaining your solution and the app.

Solutions for the algorithmic part of this assignment are possible to find online. Please be advised though that we really do expect you to try and solve this without just googling the solution. In the end the most interesting thing is not whether you have the absolute most optimal algorithm, but rather your thought process and work process for how you arrived to your solution.

Therefore please also in your README.md explain not just what your solution is, but how it works and how you found it in terms of your work and thought process.

Happy hacking 😁!

About

Pleo's Interview Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.6%
  • HTML 11.4%