Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Please use spoiler flag next time, You're missing where the closing
"
is. It's been asked and answered before.This comment is hidden because it contains spoiler information about the solution
I would agree with it being harder than 7kyu.
Ah, I guess I missed that part. I really should use my glasses more often.
No, the tests are ok. Read the instructions again:
You're there in the tie cases and you should return the lexicographically lowest character.
Some of the tests for this problem are incorrect:
const chai = require("chai");
const assert = chai.assert;
describe("Example cases", function() {
it("basic tests", function() {
assert.strictEqual(solve('a'), 'a');
assert.strictEqual(solve('aa'), 'a');
assert.strictEqual(solve('bcd'), 'b');
assert.strictEqual(solve('axyzxyz'), 'x');
assert.strictEqual(solve('aabccc'), 'c');
});
});
the third and forth tests should be written as follows:
assert.strictEqual(solve('bcd'), 'd') //d's value is greater than b
assert.strictEqual(solve('axyzxyz'), z) //z's value is greater than x
try use parseInt
This comment is hidden because it contains spoiler information about the solution
use parseInt(variableName)
that's in string format you need to convert it to int
Well that's great, but could we know what that error message said?
And what was your code? Mark your post as having spoiler content if you post it, probably you were doing something wrong.
I used a non-regex solution. I kept getting an error everytime I tried to run it with regex. Which means it's something wrong with codewars that was causing the issue.
I don't know what you're talking about. Regex works fine, as you can see in the solutions. (since you solved it)
This is supposed to be a "Regex" challenge, however, it wouldn't work for me when I used regexp, it told me I can't use those.
Thank you for pointing that out, my vision isn't that great, I just went in and added a + to the beginning of the return statement and it fixed that issue.
Loading more items...