Giter Site home page Giter Site logo

python-interview-qst's Introduction

algo-python-code

you're given a list of time intervals during which students at a school need a laptop.

These time intervals are represented by pairs of integers [start, end], where 0 <= start < end.

However, start and end don't represent real times; therefore, they may be greater than 24.

No two students can use a laptop at the same time, but immediately after a student is done

using a laptop, another student can use that same laptop. For example, if one student rents a

laptop during the time interval [0, 2], another student can rent the same laptop during any

time interval starting with 2. Write a function that returns the minimum number of laptops

that the school needs to rent such that all students will always have access to a laptop when

they need one. laptopRentals(times)

Parameters times: Array (of Array (of Integers)) - A 2D array containing the times the

student would require a laptop.

Return Value Integer - Minimum number of laptops the school needs to rent.

Examples times Return Value

[[0,2],[1,4],[4,6],[0,4],[7,8],[9,11],[3,10]] 3

[[0,4],[2,3],[2,3],[2,3]] 4

[[1,5],[5,6],[6,7],[7,9]] 1

def laptopRentals(times): pass

python-interview-qst's People

Contributors

archie-bryann avatar

Watchers

James Cloos avatar  avatar

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.