注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
好像没看到人发过Ramp的这套OA,我来分享一波,求米求米求米求米!
add_worker(self, worker_id: str, position: str, compensation: int) -> bool — should add the worker_id to the system and save additional information about them: their position and compensation. If the worker_id already exists, nothing happens and this operation should return False. If the worker_id was successfully added, return True. worker_id and position are guaranteed to contain only English letters and spaces.
register(self, worker_id: str, timestamp: int) -> str — should register the time when the worker_id entered or left the office. The time is represented by the timestamp. Note that register operation calls are given in the increasing order of the timestamp parameter. If the worker_id doesn't exist within the system, nothing happens and this operation should return "invalid_request". If the worker_id is not in the office, this operation registers the time when the worker_id timestamp. No restrictions are applied to start_timestamp and end_timestamp, except that it is guaranteed that end_timestamp > start_timestamp >= 0. Note that workers are only paid for the time they were present in the office. The amount of time is calculated using finished working sessions only. For any finished working session [session_start_timestamp, session_end_timestamp] salary is calculated as salary = (session_end_timestamp - session_start_timestamp) * compensation_during_period. Note, that compensation_during_period may differ for different periods, because workers may be promoted. If worker_id doesn't exist within the system, nothing happens and this operation should return None |