注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
给了三道take home,发过去之后告诉我没有过也没给任何feedback,浪费时间。。。
Problem 1.
Write a Python function that takes numpy array of booleans and returns a numpy array of type int64. The i-th element in the resulting array should contain the distance from the closest true in the input array at or before position i. The resulting array should have a -1 if there is no True value at the current or any previo您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 100000000. Implementation with python loop over all elements is not considered sufficiently efficient.
Include a unit test that checks relative error of output of your solution for N=20 against an output of a simple solution that accumulates all sums explicitly.
|