Medium
Given the head of a linked list, remove every node which has a node with a strictly greater value anywhere to its right. Return the head of the modified list.
Input: head = [5,2,13,3,8] Output: [13,8]
Input: head = [1,1,1,1] Output: [1,1,1,1]