Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
AVS3123123131231
(version: 0)
Comparing performance of:
A vs V
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
A
var firstMissingPositive = function(nums) { nums = nums.sort(function(val1, val2) { return val1>val2?1:val1<val2?-1:0; }); if(nums.length===0||nums[nums.length-1]<=0){ return 1; } // A, B for(var i=0,k=1; i<nums.length; ++i){ // C if(nums[i]>k){ return k; } k = nums[i]<k?k:k+1; } return nums[nums.length-1]+1; // D };
V
var firstMissingPositive = function (nums) { let s = 1; let i = 0; let w = false; do { w = false; for (i = 0; i < nums.length; i++) { if (s == nums[i]) { s++; w = true; } } } while (w == true) return s };
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
A
V
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
SJCL sym vs asym
SJCL sym vs asym
tartatbrdazb
Reverse array
testoffors1
Comments
Confirm delete:
Do you really want to delete benchmark?