Skip to content

24. Design Elevator Management System - Single Lift #1

@kavinash09

Description

@kavinash09

Driver Input

        LiftSystem ls = new LiftSystem(15, 2);
        System.out.println(ls.getLiftState());
        System.out.println(ls.addRequest(1, 10));
        System.out.println(ls.addRequest(1, 12));
        System.out.println(ls.addRequest(1, 14));
        System.out.println(ls.addRequest(1, 14));

For this input it is always accepting request and returning true
however lift capacity is 2
so ideally it should fail

and when there is no one on board
it is looking for the nearest job to pick
ideally it should serve opposite direction first regardless of the nearest job priority else It will lead to starvation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions