Company: ibm_23oct
Difficulty: medium
Question 2 Problem Description You are given a singly linked list of positive integers. Delete every node that stores an odd value and return the head of what is left. The nodes that remain (the even-valued ones) must stay in the same relative order as in the original list. If every node is odd, nothing remains and the function returns a null head. Function Description Complete the function removeOddNodes . Parameters: head ( ListNode ): the first node of the list. Each node has an integer field data and a field next that points to the following node (null after the last node). Returns: the head node of the list after all odd-valued nodes are deleted, or null if no node is left. Input Format Read from standard input (the provided code reads the input and builds the list for you). The first line contains an integer n , the number of nodes. Each of the next n lines contains one integer, the data of the next node, from head to tail. Output Format The provided code prints the returned list