Book allocation implementation

why are we using min here

hello @ajayrajsingh_817
that is redundant, u can direclty update ans.