新手问题 (删帖) leetcode-cn 的 ruby 测试用时是不是有问题?

u4crella · May 02, 2020 · Last by u4crella replied at May 02, 2020 · 2676 hits

删帖。原来是我太水了。还好我也在努力进步,哈哈。

我发现 leetcode-cn 好像歧视 ruby。

第 315 题,链接是 https://leetcode-cn.com/problems/count-of-smaller-numbers-after-self/submissions/ ,用 ruby 来解,有 22031 个那么多;而且环境还是 ruby 的 2.4.9 版本。我把 js、python 版本的其他示例题解再提交上去,记录源数组的大小:print(len(nums)) 或 console.log(nums.length); 并使代码 fc,发现它们的源数组的长度都只是个位数。

这样比超时怎么比得了啊?

我在“显示详情”那里把网站设定的这题用来测试 ruby 的原数据下载下来,再在自己电脑上测试算法,起码前 20 个的数目是没问题的。

scr.jpg

scr02.jpg

huacnlee closed this topic. 12 May 18:57
You need to Sign in before reply, if you don't have an account, please Sign up first.