Ad
  • Custom User Avatar

    @ZooBiscuit1999 I didn't make the connection either. Could've been worded better to avoid confusion.

  • Custom User Avatar

    This one was tricky for sure (tricky for me because i'm brand new to c#), but I managed to solve it in c#. I don't know how "correct" my code is, but I passed all the tests. What's strange is that I tested my code in rextester.com and whenever I tried to pass an array to UniqueInOrder, it kept failing at compilation. Ex: UniqueInOrder([1,2,2,3,3]) I'm a novice programmer relatively speaking, but I've been here long enough to see that a lot of katas have legitimate issues. This one might be one of them? It'll be interesting to see what a (1 kyu) person says. Surprised nobody has responded to you yet.

  • Custom User Avatar

    By 'The first item' test, I assume you mean, cases where the test is like this arr = [1, 2, 2, 2]. It's not passing because you initially assign 0 to n (totally fine), but then later, you're reassigning n to be arr[1], since arr[1] is not in non_unique at this point (at this point, non_unique only has arr[0]). Since you are adding items to an array and comparing, try adding the 2nd item into your non_unique array, then go from there. If you do add the 2nd item though, be careful to start your loop at the 3rd index of the array, and then compare. Not sure if that's giving away too much.

  • Default User Avatar

    Thank you, my bad i should have seen the tests down there.

  • Custom User Avatar

    Don't include main function in your code. The tests call your function is_valid_ip and check the value it returns.

  • Default User Avatar

    Oh, I'm using C.
    It's what I said, when i try to test or attempt the tests are always a "Log". Then even if the answear is 1 or 0 it's always wrong.

  • Custom User Avatar

    Please say which language you're using and give more concrete elements, it's hard to help otherwise. You should read this: https://docs.codewars.com/training/troubleshooting/

  • Default User Avatar

    So when I try to attempt or test it appear that log is a valid option i guess, idk waht this means.

  • Custom User Avatar

    Read some of the many posts below asking the same.

  • Default User Avatar

    why this IP is invalid 1.2.3.4

  • Custom User Avatar

    It's possible you are not allowed to put a spoiler flag afterward, included on your own message, until you did earn a certain amount of honor points, I don't remember. Don't worry, it's not big issue. Just try to remember it before publishing next time until you have this privilege :)

  • Custom User Avatar

    Thanks for the heads up and for the doc. I actually tried to put the spoiler flag, but it said I didn't have enough privilege or whatever. I forgot what it said.

  • Custom User Avatar

    Please use a spoiler flag when you post code, so that users who didn´t solve the kata cannot see it; I put the flag for you this time. You may find some helpful tips to solve your problem on the documentation page: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I agree that this should be a go to solution, but might I say ==> only if you are privy to the actual formula for finding the sum between two numbers? Safe to say, most folks aren't aware of this mathematical approach you're referring to, which probably explains why they're using other techniques. I'm coding in Ruby and I decided to use "one of those methods that adds values of an arr and returns the sum" method.

    btw: I tested that formula for this challenge, and it worked perfectly. Thanks for sharing :)

  • Loading more items...