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.
good kata for learning things about chains
When your result looks like the expected one, but still fails, it is helpful to print your string between delimiters and escape whitespace characters.
For your situation:
for
n = 1
, this prints:"*\n \n"
while the expected answer is:
"*\n"
The problem comes from your code. You are casting a negative number to
usize
, which results in a really big unsigned number. And then you use this number as the bound in a loop in which you allocate memory, hence the allocation failure.My Rust solution should work, but adding the appropriately placed newline characters gives this result. This only pops up when the answer is correct - if I add a newline character at the start of the string, the test fails and no error occurs.
memory allocation of 9223372036854775806 bytes failed
Caused by:
process didn't exit successfully:
/workspace/target/debug/deps/challenge-07bd72047d917620 --show-output -Z unstable-options --format json
(signal: 6, SIGABRT: process abort signal)This one really took a toll on me! TvT
This comment is hidden because it contains spoiler information about the solution
Thank you so much for your sugestion! I rewrote the code with an empty array concating other arrays and it worked:)
try your code with a string that has no
'a'
, but that has other vowelsAlso:
console.log(str)
;)This comment is hidden because it contains spoiler information about the solution
Language?
The registers to use r unclear: idek where the string is located
This comment is hidden because it contains spoiler information about the solution
I'm kindof sad that regexp_count is not available in postgres 13.
Approved
This comment is hidden because it contains spoiler information about the solution
Loading more items...