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.
Well it is a 7...
How did you do this in constant time? That doesn't seem possible.
Great! for future reference this shouldn't be marked as an "issue" but as a "question".
Edit: problem solved
This was harder than I thought it would be...
A week or two ago I struggled on this one. Spent a few hours trying to figure it out. Did a different problem that "clicked" differently and then it gave me an idea for this one...and 10 mins later it's done. Ahhhh.....
Thank you to the author this was a good one!
This comment is hidden because it contains spoiler information about the 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
Worked fine on my end. Are you filtering by len()?
God I love Python...a 7kyu for a simple one line.
This comment is hidden because it contains spoiler information about the solution
Thanks. I've not heard of Gitter, but have been using Reddit, under the general r/learnprogramming. They've been super helpful and there is a ton of traffic there. But, while I finally felt like I had a handle on malloc, and basic stuff, this got to me. I just couldn't figure it out. So far the folks responding to my questions here have been great too. I think you've answered some of my questions as well. I was just unhappy I couldn't understand how to start such a base level problem.
It's not the biggest deal in the world but I know for me it feels discouraging. Especially this puzzle. The actual logic on this was easy to get down once I could just understand how at least get the data to output. I've done a few 5 and 6 katas (in C) and they were easy compared to this, because I could understand how to get access to the data (and return the correct data, another hard point in C here). Granted, my solutions are not eqloquent by any stretch of the imagination but the first step is at least knowing how to get the data!!
As for why I am bothering to understand basic C? I dunno. Maybe a glutton for punishment? It feels like a basic building block for me, starting at the bottom of programming. The online course I took started with C and moved to Python after five or six weeks. Mostly I'm doing the C problems because I don't want to forget what I've learned already.
Hi thanks for taking the time to write back. I had no idea we had to return malloc'd memory. Or how one knows that you must do that. Thanks for the heads up. Frustrating that I just can't seem to grasp anything in C - nothing seems consistent in these puzzles. Not their fault, you are already supposed to know all this stuff, but incredibly frustrating as a newbie doing a level 8 puzzle and I can't even get past the first step that I thought would be a simple
printf
.I read the descriptions and am like "hey I got this" and the go to the next page and...I've got nothing
Just thinking aloud, it would be neat if there was a
hints
tab for those of us who don't quite get it. Not full blown answers, but stuff like this, "you must return malloc'd memory" and the reasons why. Because, I don't really understand why we must to be honest. Just that your solution worked lol. So I'm not really learning anything. Not picking on the site, this is great, and helping a lot, but I feel like I'm mostly just guessing and hoping stuff works vs understanding the reasons behind it. Thanks again.I'm not really sure how these are ranked. I've spent half an hour trying to just get the size of the array, or the array, to print in C. I keep getting memory errors. Even a simple
printf("%zu", a);
for the array size doesn't work. I've been really attempting to learn C but when one can just writeprint(ages)
in python and presto it's there, wtf over? I just have no understanding of how to access the information via these functions. The python problems seem super easy by comparison. Just getting access to the information in C is like 90% of the battle. /rantLoading more items...