You are not logged in. Please login at www.codechef.com to post your questions!

×

Why my solution is wrong? TSORT

import java.util.Scanner; import java.util.Set; import java.util.TreeSet;

public class TSORT {

public  static  void  main(String[] args)
{
    Scanner scanner = new Scanner(System.in);
    Integer count = scanner.nextInt();
    Set<Integer> arrayList = new TreeSet<>();
    for (Integer i = 0 ; i <  count ; i++)
    {

        Integer x = scanner.nextInt();
        arrayList.add(x);
    }

    for (Integer example : arrayList)
    {
        System.out.println(example);
    }
}

}

asked 15 Dec '18, 23:45

anandkhot007's gravatar image

0★anandkhot007
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×38

question asked: 15 Dec '18, 23:45

question was seen: 24 times

last updated: 15 Dec '18, 23:45