pub(crate) struct MovieRentingSystem1912 {
pub(crate) prices: HashMap<(i32, i32), i32>,
pub(crate) movies: HashMap<i32, BTreeSet<(i32, i32)>>,
pub(crate) pq: BTreeSet<(i32, i32, i32)>,
}Expand description
1912h Design Movie Rental System
Fields§
§prices: HashMap<(i32, i32), i32>§movies: HashMap<i32, BTreeSet<(i32, i32)>>§pq: BTreeSet<(i32, i32, i32)>Implementations§
Source§impl MovieRentingSystem1912
impl MovieRentingSystem1912
Sourcepub(crate) fn new(n: i32, entries: Vec<Vec<i32>>) -> Self
pub(crate) fn new(n: i32, entries: Vec<Vec<i32>>) -> Self
0 <= Shop < 3*10^5 1 <= Movie, Price <= 10^4
pub(crate) fn search(&self, movie: i32) -> Vec<i32>
pub(crate) fn rent(&mut self, shop: i32, movie: i32)
pub(crate) fn drop(&mut self, shop: i32, movie: i32)
pub(crate) fn report(&self) -> Vec<Vec<i32>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MovieRentingSystem1912
impl RefUnwindSafe for MovieRentingSystem1912
impl Send for MovieRentingSystem1912
impl Sync for MovieRentingSystem1912
impl Unpin for MovieRentingSystem1912
impl UnsafeUnpin for MovieRentingSystem1912
impl UnwindSafe for MovieRentingSystem1912
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more