1.

Delete a singly linked list. Your task is to complete the method deleteList() which deletes linked list . The function returns 0

Input:

The first line of input contains an integer N denoting the number of elements of the linked list. Then in the next line are N space separated values of the linked list. 

User Task:

The task is to complete the function deleteList() which should delete the node at required position.


Constraints:

1 <= T <= 300

2 <= N <= 100

1 <= x <= N


Example:

Input:


8

2 4 5 6 7 1 9 0
 

2.

Given two integer arrays of same size, “arr[]” and “index[]”, reorder elements in “arr[]” according to given index array. It is not allowed to given array arr’s length.

Example: 
Input:  arr[]   = [10, 11, 12];
        index[] = [1, 0, 2];
Output: arr[]   = [11, 10, 12]
        index[] = [0,  1,  2] 
Input:  arr[]   = [50, 40, 70, 60, 90]
        index[] = [3,  0,  4,  1,  2]
Output: arr[]   = [40, 60, 90, 50, 70]
        index[] = [0,  1,  2,  3,   4]

Expected time complexity O(n) and auxiliary space O(1)

3.

Given a singly linked list. The task is to find the length of the linked list, where length is defined as the number of nodes in the linked list.

Example 1:

Input:
8
2 4 5 6 7 1 9 0
Output: 8
Explanation: Count of nodes in the 
linked list is 8, which is its length.

Example 2:

Input:
5
3 4 5 7 3
Output: 5
Explanation: Count of nodes in the
linked list is 5. Hence, the output
is 5.

Your Task:
Your task is to complete the given function getCount(), which takes a head reference as an argument and should return the length of the linked list.

Expected Time Complexity : O(N)
Expected Auxilliary Space : O(1)

Constraints:
1 <= N <= 105
1 <= value <= 103