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.
the standard term is "Variably Modified types", and yes they are distinct from VLAs, only the VM types will be mandatory in C23, the VLAs are still optional
Is this really called "VLA declaration"? I always thought that "VLA" is used only to refer to stack allocated arrays with runtime decided size.
no, your prototype is worse. you use the pointer notation for an array, and you dont make it clear that
size
is the length of the array. the only thing wrong with the current prototype is that MSVC does not support VLA declarations, but these will be made mandatory in C23You can solve this with pen and paper faster than C. Think first, then code second.
A fast language is not enough to compensate a deficient algorithm. The kata is perfectly fine.
Fixed by changing class and method names to
FindOccurrence.findNthOccurrence
. Thank you!you need to convert to wanted doubles earlier (separate line), then do all the math on doubles.
then simple int(r) should work
Are you sure? You are close, but read the instructions carefully. You are missing something important in the description.
This comment is hidden because it contains spoiler information about the solution
Mark your post as having spoiler content next time, please.
About your code, the range is wrong and why are you using that filter for? Those things are what makes your code so slow.
Either you're using recursion / looping infinitely, or your algorithm is very slow. I'd bet it's the first option, I'm passing JS tests in 2 secs with inefficient algorithm. Try to figure it out with sys-out printlns.