DataLane

18. Unique sorted

mediumProNot started~6 minPythonImplement unique_sorted()

Asked in screens shaped like: Apple, Amazon

Return the unique values of x in ascending order as a list of floats.

Examples

  • Example 1

    Input: { "x": [3, 1, 2, 1] }
    Output: [1, 2, 3]

Constraints

  • 1 <= n <= 10**5, where n is the length of the input
  • Input is non-empty

Python editor

Loading Python engine…

Ctrl/Cmd + Enter submits

Run your code to see stdout.

Pro problem

Medium problems unlock with Pro

Easy pads stay free. Medium and hard SQL and Python problems — editor, tests, hints, and solutions — open after you upgrade to Pro or coaching.

See plansPractice free easy problems
↑↓ navigate openesc close