{"id":15419440,"url":"https://github.com/arjunrn/messy-solution","last_synced_at":"2026-06-19T12:33:18.691Z","repository":{"id":142093902,"uuid":"36560720","full_name":"arjunrn/messy-solution","owner":"arjunrn","description":null,"archived":false,"fork":false,"pushed_at":"2015-05-30T16:43:52.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T12:45:44.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjunrn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-30T14:11:19.000Z","updated_at":"2015-05-30T14:14:02.000Z","dependencies_parsed_at":"2023-03-13T10:19:58.528Z","dependency_job_id":null,"html_url":"https://github.com/arjunrn/messy-solution","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunrn%2Fmessy-solution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunrn%2Fmessy-solution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunrn%2Fmessy-solution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjunrn%2Fmessy-solution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjunrn","download_url":"https://codeload.github.com/arjunrn/messy-solution/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239994005,"owners_count":19730780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T17:25:04.401Z","updated_at":"2025-11-11T12:04:10.546Z","avatar_url":"https://github.com/arjunrn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Solution\n\n###Assumptions\n1. The unit of time is the time for an elevator to move a single floor.\n2. Moving up or down takes the same amount of time.\n3. All elevators take the same amount to time for a unit.\n\n\n### Instruction to Run\n`go run *.go`\n\nEnter the number of floors in the building the number of elevators\n\n\tEnter Number of Elevators: 5\n\tEnter Number of Floors: 20\n\nThen run the simutation by stepping forward or submitting a request for the elevator\n\n\tEnter Your Choice\n\tSummon Elevator(S) ; Step Forward(F) ; Print Status (P); Exit(X)\n\ts\n\tFloor, Destination: 13 18\n\tThe elevator selected to service the call is: 0\n\tIt has to travel 18 floors.\n\tEnter Your Choice\n\tSummon Elevator(S) ; Step Forward(F) ; Print Status (P); Exit(X)\n\tf\n\tMoving\n\tEnter Your Choice\n\tSummon Elevator(S) ; Step Forward(F) ; Print Status \t(P); Exit(X)\n\tf\n\tMoving\n\t\n## Lessons learnt\nThere should a 2 queues for the elevator. One queue is where it has to pickup passengers and the other where is has to drop them off. When the elevator picks up a passenger it should prompt for input. Unfortunately, this solution does not have this. As a result even the lift does not travel in the opposite direction. For example if the lift is on floor 10 and it has to pickup a passenger at floor 6 and deposit them at floor 8 it will only go from floor 10 to floor 6 stopping at floor 8 on the way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunrn%2Fmessy-solution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjunrn%2Fmessy-solution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjunrn%2Fmessy-solution/lists"}