MetaSoftware Engineer · Take-home ProjectCodemia practiceCount median in linked list
Given a singly linked list of integers, write a function to calculate and return the median value of the elements in the list. If the number of elements is odd, return the middle element; if even, return the average of the two middle elements. The function should handle edge cases, such as an empty list, appropriately.