Thank you for your comment! As you said, in addition to faster processing speed, the readability of the code also improves.
This comment is hidden because it contains spoiler information about the solution
Clever, but very slow. My solution is 4.27x faster.
This is almost twice as slow than using a for of with a stack array that joins at the end, but it's clever.
This is almost twice as slow than using a for of with a stack array that joins at the end.
a for of to the string is faster and more readable.
Awesome. 268x faster than my solution.
describe("Solution", function() { it("should test for something", function() { var helper = new PaginationHelper(['a','b','c','d','e','f'], 4); assert.strictEqual(helper.pageItemCount(0), 4); assert.strictEqual(helper.pageItemCount(1), 2); assert.strictEqual(helper.pageItemCount(2), -1); var helper2 = new PaginationHelper(['a','b','c','d','e','f'], 2); assert.strictEqual(helper2.pageItemCount(-1), -1); assert.strictEqual(helper2.pageItemCount(0), 2); assert.strictEqual(helper2.pageItemCount(1), 2); assert.strictEqual(helper2.pageItemCount(2), 2); assert.strictEqual(helper2.pageItemCount(3), -1); }); });
They are passing, but the Attempt is not. I also think there is a problem.
Terribly indented code 🤮
you're overthinking this: this approach is actually very bad (think about its time complexity)
Awesome!
Loading collection data...
Thank you for your comment!
As you said, in addition to faster processing speed, the readability of the code also improves.
This comment is hidden because it contains spoiler information about the solution
Clever, but very slow. My solution is 4.27x faster.
This comment is hidden because it contains spoiler information about the solution
This is almost twice as slow than using a for of with a stack array that joins at the end, but it's clever.
This is almost twice as slow than using a for of with a stack array that joins at the end.
a for of to the string is faster and more readable.
This comment is hidden because it contains spoiler information about the solution
Awesome. 268x faster than my solution.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
They are passing, but the Attempt is not. I also think there is a problem.
Terribly indented code 🤮
you're overthinking this: this approach is actually very bad (think about its time complexity)
Awesome!