Ad
  • Custom User Avatar

    I enjoyed this a lot! I thought the tests were well put together -- I was able start small and gradually implement each new feature, with a nice feedback loop along the way.

  • Custom User Avatar

    Generic types seem to be stripped out of error messages for Java code. I'm guessing it's some HTML escaping thing. For example, if I have a line like this:

    Set<Integer> = new HashSet<Integer>(integers);
    

    which e.g. doesn't compile because integers is an int[], I get an error that looks like this:

    /tmp/java2379247929157926776/UniqueArray.java:6: error: no suitable constructor found for HashSet(int[])
    Set seen = new HashSet(integers);
    ^
    
  • Custom User Avatar

    Okay ya, turns out I was (inadvertently) returning undefined. That's sort of a misleading error though :s

  • Custom User Avatar

    I get SyntaxError: Unexpected token u for any solution I try, including just leaving the provided code as is.

  • Custom User Avatar

    Okay, fixed. (I'm more of a python person.)

  • Custom User Avatar

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

  • Custom User Avatar

    I'm not sure how to up vote this? There's no up vote button where there usually is (next to "Share this kata:").

  • Custom User Avatar

    Loved it!
    I'd love to see more sophisticated compiler-y kata in this style.

  • Custom User Avatar

    It wasn't stated in the description that the order of elements in each partition should be preserved.
    Either the test cases should be less strict about this, or the description should mention this.
    (I tried a cutesy solution that calls Array.sort using the predicate as a comparator; it had the right elements in each partition and returned the correct index but the elements weren't in the same order.)