7 Comments


  1. This code will not compile. It gives the error “The type HashSet is not generic; it cannot be parameterized with arguments “.

    Reply

  2. It is a good question.this question replace set.remove(i-1) to set.remove((short)(i-1)) when answer is 1

    Reply
  3. Dan Zhuo

    Even i by itself is type “short”, the calculation result of “i-i” is type int, which need explicitly cast to “short”, the set cannot find the Integer “i-1” in Short Set.

    Reply
  4. Artur

    what is the GoogleTEDTalks where this question appears?

    Reply
    • admin

      This question was discussed in a TED talks video and is available in YouTube. The video was shared with id GoogleTEDTalks. You could search for GoogleTEDTalks in YouTube and should en able to get it.

      Reply

Leave a Reply.. code can be added in <code> </code> tags