terminal
Elevo
/
ESC
Login
Initiate Registration
code
Topics
corporate_fare
Companies
history
History
arrow_back
Back to Challenges
#148
Sort List
Medium
Acceptance 0%
Editorial
description
Problem Description
Given the `head` of a linked list, return the list after sorting it in ascending order.
checklist
Constraints
The number of nodes in the list is in the range [0, 5 * 10^4].
-10^5 <= Node.val <= 10^5
science
Examples
Case #1
In:
head = [4,2,1,3]
Out:
[1,2,3,4]
Case #2
In:
head = [-1,5,3,4,0]
Out:
[-1,0,3,4,5]
Mastery Tags
Linked List
Sorting
Hiring Companies
Amazon
Google
Meta
code
Integrated IDE
Python 3
expand_more
C
C++ 17
Java
JavaScript
Python 3
C
C++ 17
Java
JavaScript
Python 3
refresh
class Solution: def sortList(self, head: ListNode) -> ListNode: pass
Login to Compile
Processing
terminal
Debug Output
home
Home
extension
Practice
robot_2
login
Sign In
account_circle
Menu
code_blocks
Coding
psychology
Aptitude
Navigation
close
Login
Registration