Code Monkey home page Code Monkey logo

graph-shortest-path's Introduction

#Find the optimal path for the lift# In this building, the lift can go to any apartment. Find the optimal path for the lift, taking into account that the time needed to pass through an apartment varies.

Apartments and floors are numbered from the left bottom corner of the building, starting with 0.

##Input:## A matrix T with N*M elements specifying the time it takes for the lift to pass through an apartment. T[i,j] equals 0 means that there is no way through that apartment [i,j].

##Output:## Link to a Codepen project with

  • a building HTML layout
  • input fields for floor/apartment
  • a GO! button to start lift movement

Lift movement should be animated proportionally to the time needed to pass through an apartment.

##Constraints:## 0 < N, M <= 100 0 <= T[i, j] <= 5000

##Example:## const A = [ [100, 210, 200], [300, 0, 40], [91, 50, 20] ] Current lift position: 0, 0 (value 91) Input: Move lift to floor 2 flat 1 (value 210) Expected lift movement: [[0, 1], [0, 2], [1, 2], [2, 2], [2, 1]], total time 520 (=50+20+40+200+210)

##Solution evaluation criteria:##

  • Code quality
  • Visual appearance
  • Implementation conciseness and simplicity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.