• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
Ndumiso Avatar
Name:Ndumiso
Clan:Psybergate-Code-Wars
Skills:java, javascript, c++, c#.net, vb.net, sql
Member Since:Feb 2017
Last Seen:Feb 2025
Profiles:
Following:341
Followers:324
Allies:324
View Profile Badges
Ad
Educator, struggling to assess your students?
Assess your classroom or bootcamp with the world leading assessment platform, Qualified.Request your demo today!
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (38)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • JohanWiltink
    • resolved a question on "Follow that Spy" kata
    • 14 months ago
  • Custom User Avatar
    • 4real
    • commented on "Follow that Spy" kata
    • 4 years ago

    for me it fails in Java.
    if I change this: ->
    assertEquals("Halifax, Montreal, Toronto, Chicago, Winnipeg, Seattle",
    routes.findRoutes(new String[][]{{"Chicago", "Winnipeg"}, {"Halifax", "Montreal"}, {"Montreal", "Toronto"}, {"Toronto", "Chicago"}, {"Winnipeg", "Seattle"}}));

    to this: -> assertEquals(Chicago, Winnipeg, Seattle",
    routes.findRoutes(new String[][]{{"Chicago", "Winnipeg"}, {"Halifax", "Montreal"}, {"Montreal", "Toronto"}, {"Toronto", "Chicago"}, {"Winnipeg", "Seattle"}}));
    it works fine but still it is changed back when pressing submit.

  • Custom User Avatar
    • nuzyly
    • commented on "Sum and Count All Odds vs Evens" kata
    • 6 years ago

    I strongly agree. Also with the return type being int I missed a clear expectation of how overflow should be handled. The expectation is only defined implicitly by the (failing) tests, which is not the nicest way to define how to handle these cases.

  • Custom User Avatar
    • donaldsebleung
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 6 years ago

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

  • Custom User Avatar
    • donaldsebleung
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 6 years ago

    The Submit tests only test for the element at index 1 when the input array is null - it should also check that the element at index 0 is 0 in that case.

  • Custom User Avatar
    • donaldsebleung
    • commented on "Sum and Count All Odds vs Evens" kata
    • 6 years ago

    @Ndumiso,

    FYI here is a guide on writing random tests. It's in JavaScript and not Java but the overall concepts should be applicable anyway.

  • Custom User Avatar
    • Ndumiso
    • commented on "Connect Four" kata
    • 6 years ago

    How do you see the input ?

  • Custom User Avatar
    • Ndumiso
    • resolved an issue on "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    raise to the power, thanks

  • Custom User Avatar
    • Voile
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    As far as the current test goes I can return new int[] {1, 1331, 2, 3, 4, -1, 0} and the test will still consider my result correct.

    Please use assertArrayEquals in place of assertEquals so you can test equality in one, single test that will ensure the content is always equal.

  • Custom User Avatar
    • Voile
    • created a suggestion for "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    Is the null test necessary? What does it even achieve?

  • Custom User Avatar
    • Voile
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    By how the kata is defined the number will be out of the range of an int (and even a long) very quickly. The return type should be BigInteger.

  • Custom User Avatar
    • Voile
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    and square each sum by it's corresponding number of occurrences

    This is the wrong terminology. Squaring a sum is always raising the number to a power of 2, but in here we're required to raise the number to the power of the occurrences instead.

  • Custom User Avatar
    • Voile
    • created an issue for "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    Your tests organization makes no sense. Why is there a non-null test in the testNullability?

  • Custom User Avatar
    • Blind4Basics
    • commented on "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    except if you print them with Arrays, so that's fine by me... ;p

  • Custom User Avatar
    • FArekkusu
    • commented on "Sum and Count All Odds vs Evens" kata
    • 7 years ago

    [1 3 7]

    That's not how arrays in Java look like...

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...