注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
本帖最后由 cloudfarm 于 2025-2-2 14:45 编辑
不是论坛里面的90分钟的题. 是一个45分钟的.
We want to query an API endpoint to receive data about currently available apartment listings from a rental website. Among the data fields is a column called num_bedrooms , which takes the value of 1 for a "1-bedroom" apartment and 0 for a "studio".
Note: This rental agency only works with studios and 1-bedroom apartments, so there will never be 2+ bedroom listings. Each listing includes information about aor aapartment, so there will never be a listing with both aandofferings in one posting.
The algorithm used occasionally mistags the num_bedrooms
value. Specifically, sometimes a "studio" is tagged as having num_bedrooms = 1
or a 您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 Unlock interview details and practice with AI Popular Interview Questions from Top Companies
_CODE_36 ].In the fourth listing,=- "Beautiful studio with a nearby art studio."
复制代码 should have. Ignore the second appearance ofsince it is followed by.
Input/Output- [execution time limit] 4 seconds (py3)
- [memory limit] 1 GB
- [input] string jsonData
String in JSON format. It's guaranteed that each listing contains the fields,,,and.
Guaranteed constraints:- 136 ≤ jsonData.length ≤ 15366
复制代码 . - [output] array.integer
Return an array that contains the correct values forfor all of the listings in.
Note for Python3 users: if you use a numpy array, casting to a list creates a list ofintegers. Your returned array needs to be an array of standard Pythontypes.
|