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.
@hobovsky
Thanks for the suggestion. Its actually what I did and it helped me solve the problem. I read about the problem and the theory behind the solution, after looking at some different algorithms for that I wrote down one I particularly liked and after understanding how and why it worked I used it to solve the problem and was actually quite amazed at how inefficient I had been approaching the problem. My solution used to run at about 108. something ms on the basic tests, and the solution I submitted ran the same tests with a new one I made with 1 million cycles faster than that.
Again, thanks for the suggestion and for future readers I really recommend reading up on this as it does make a lot of sense when it finally clicks
it seems you have more than one problem with your approach:
I suggest doing some more research (i.e. googling) and looking for some loop detection algorithms. you will definitely find something.
C#
Im stopping for now as obviously Im missing something. My tests pass but I get a time out at the actual attempt. I'm using a single linear loop to go through all of the nodes, adding them to a List and checking if the current node I am at is present in the list. If present, It means I have looped through all of them, so then I just return the count - the index of the current node.
I guess it should have a simpler solution judging by some of the comments in the Discussion but Im stuck for now, will come back to it later. I dont really see how you can figure this out without looping through all the nodes, because you only have node.next, and nothing else to indicate what text or something this node has (Judging by the image, they should have some text in them), I tried using the node itself, text, Text, GetText, value, Value, but none seem to give me any values. I also tried using reflection to print out the properties and also got only .next.