This was a fun kata, but I think the description should be changed from this:
"The purpose of this kata is to find words I can type quickly on this dumb keypad, hence good words. Good words herein have characters that are on the same pad, or vertical opposite the pad, or horizontally opposite the pad."
to this:
"The purpose of this kata is to find words I can type quickly on this dumb keypad, hence good words. To be a good word, each key must share the same row or column as the last key."
Really fun kata for practicing dynamic regex construction!
Loved how it blends string manipulation with pattern logic — very satisfying to solve. Thanks!
Thank you, I saw another's post about the multiplication algorithm reference and changed course. Both your comment and that one were very helpful! I still think that could be better explained in the prompt rather than buried in the discussion. Would have saved me a whole afternoon anyway haha
I think you might be approaching this from a wrong angle. To solve this challenge, you do not have to know how BigInt works internally. To solve this challenge, you need to figure out how to do multiplication of large numbers. And there is many ways to do this, and one of such ways is taught in schools.
Forget BigInt, forget inheritances, forget how javascript objects work under the hood. There is no need for it here. You know how to multiply two large numbers without a computer, right? You can use the same approach to solve this task.
I really like this kata, thank you! One note - I wish the prompt had any context whatsoever other than don't use BigInt. I'm trying to strengthen my understansing of algos, and I'm down a rabbit hole researching how javascript objects work under the hood and working my way up in inheritence. If this was a little more focused, without giving away too much, it could be super helpful for my learning. I may be going too deep and little doses of understanding and building on that would be better pedogocially speaking. Maybe a way to frame the prompt in a way to build off some intermediate knowledge as a starting point to discover something more advanced about how BigInt works.
Thankyou hobovsky and trash_incel. The addition of << std::flush allowed me to see that to my surpise the program crashed on the very first test with inputs "2" and "3" even though this compiled and ran with correct result locally. From there I deduced I was getting a -1 index. I had been looping using reverse iterator and was trying to compute the index for my vector to store the computation results using std::distance. This is were things were wrong. I guess that I was either lucky locally or my compiler was doing something smart. I had already made one of my own tests with one number as "" and again this compiled fine and gave the correct result for me locally. Anyway - I have now submitted with success. Thanks both.
This was a fun kata, but I think the description should be changed from this:
"The purpose of this kata is to find words I can type quickly on this dumb keypad, hence good words. Good words herein have characters that are on the same pad, or vertical opposite the pad, or horizontally opposite the pad."
to this:
"The purpose of this kata is to find words I can type quickly on this dumb keypad, hence good words. To be a good word, each key must share the same row or column as the last key."
fixed
all fixed
done
Really fun kata for practicing dynamic regex construction!
Loved how it blends string manipulation with pattern logic — very satisfying to solve. Thanks!
This comment is hidden because it contains spoiler information about the solution
Yes, all the integers are passed positive. I tried using the absolute value, and it didn't gave an error.
Thank you, I saw another's post about the multiplication algorithm reference and changed course. Both your comment and that one were very helpful! I still think that could be better explained in the prompt rather than buried in the discussion. Would have saved me a whole afternoon anyway haha
I think you might be approaching this from a wrong angle. To solve this challenge, you do not have to know how BigInt works internally. To solve this challenge, you need to figure out how to do multiplication of large numbers. And there is many ways to do this, and one of such ways is taught in schools.
Forget BigInt, forget inheritances, forget how javascript objects work under the hood. There is no need for it here. You know how to multiply two large numbers without a computer, right? You can use the same approach to solve this task.
I really like this kata, thank you! One note - I wish the prompt had any context whatsoever other than don't use BigInt. I'm trying to strengthen my understansing of algos, and I'm down a rabbit hole researching how javascript objects work under the hood and working my way up in inheritence. If this was a little more focused, without giving away too much, it could be super helpful for my learning. I may be going too deep and little doses of understanding and building on that would be better pedogocially speaking. Maybe a way to frame the prompt in a way to build off some intermediate knowledge as a starting point to discover something more advanced about how BigInt works.
Java translation!!
p.s. thanks for checking :)
For javascript I have the next error:
ReferenceError: Test is not defined
The kata is nice, but maybe 6 kyu rate will be more appropriate for this one. And also I think that adding the OOP tag would be useful
Thankyou hobovsky and trash_incel. The addition of << std::flush allowed me to see that to my surpise the program crashed on the very first test with inputs "2" and "3" even though this compiled and ran with correct result locally. From there I deduced I was getting a -1 index. I had been looping using reverse iterator and was trying to compute the index for my vector to store the computation results using std::distance. This is were things were wrong. I guess that I was either lucky locally or my compiler was doing something smart. I had already made one of my own tests with one number as "" and again this compiled fine and gave the correct result for me locally. Anyway - I have now submitted with success. Thanks both.
add
<< std::flush
after the values you print. flushing the standard output ensures you will see it even if the program crashesLoading more items...