AlgoUniversity
  • Go Back
Discussion
Farmer And Pipes :

Author

Akshay Sharma

Difficulty Level : Easy

Submissions : 98

Asked In : HSBC

Marks :100

: 2 | : 1

Raman is a farmer.He wants to buy some pipes of distinct sizes. There were N pipes in the ship and some of them are of the same size. The size of the pipe has been marked on the pipe using some number nums in the form of a bar code.

Write a program that scans all the bar codes and prints the number of pipes Raman can get from the shop.

Input

The first line of input contains N ($$$1 \le N \le 3*10^4$$$)

The second line contains N pipes separated by a single space ($$$-10^4 \le a_i \le +10^4$$$)

Output

The first line print the number of pipes after scanning all the barcodes.

The second line of output contains pipe sizes after scanning in ascending order

Example

Input
3
1 1 2
Output
2
1 2

Note

For sample input 1 the given number of pipes is 3 i.e 1,1,2 after scanning all the bar codes first pipe bar code and second pipe bar codes are the same. So removing one of then Raman get the two pipes of size 1 and 2

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.