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.
Hey there! What I've written in those comments was a mistake and if you have a look at my solution you'd see that I haven't declared my variable as a static one. However, you're completely right on this and I've taken your advice. I've seen that static char variables could be easily viewed with things like readelf. Thank you for reminding me again! Happy coding!
Sounds interesting! I will go for it!
Hi!
I can't thank you enough. You showed me step by step what I was doing wrong and what I could have done more accurately. You also made revisions on your own forks to help me understand the final code much easier! I learnt where I was doing unnecessary codes and how I could re-write them way simpler.Your use of strchr() and strrchr() functions was smart! It was much simpler and easier. Again Thankyou for giving so much of your time and sharing your knowledge and experience with me!
The moment of Wow! Such a smart move!
I really enjoyed this part! Finding the first occurance and then searching from on step further on!
Before reading your revisions I wasn't aware of how useful strchr() is. It simply eliminated the for loop. Nul terminating the distincts that I didn't! Thankyou for showing me that
I have a bad habit of doing everything in a manner of too "step by step". But now I've learnt to avoid it. Also how my code compares complex to yours. Not freeing string, Oh! my really bad mistake!
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
Thank you for your response. It seems really strange that my code gives a "1" for the count of duplicates in "abcdea" while I complie it using gcc 7 and not inside Code Wars. Actually, I have run this code in another online compiler, Jdoodle, which again outputs a "1" for the input "abcdea". Here's a link: https://www.jdoodle.com/ia/fD8
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
This comment is hidden because it contains spoiler information about the solution