Detail Form
We will send your result on your email id and phone no. please fill detail
Pairs and vectors can be used together to achieve some amazing results. Here we will learn to use a vector that holds pairs.
You are given a vector V of size n. The vector hold pair of integers. Example V={(1,2),(3,4)...}. Now, you need to sum the second elements.
Input Format:
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line contains n denoting the size of the array. The second line contains 2*n elements.
Output Format:
For each testcase, in a new line, print the required output.
Your Task:
Since this is a function problem, you don't need to take any input. Just complete the provided function sum().
Constraints:
1 <= T <= 100
1 <= n <= 107
0 <= Vi <= 107
You are given a vector V of size n. You need to sort it and reverse it.
Input Format:
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line contains n denoting the size of the array. The second line contains the space seperated elements of the vector.
Output Format:
For each testcase, in a new line, print the required output.
Your Task:
Since this is a function problem, you don't need to take any input. Just complete the provided functions sortVector() and reverseVector().
Constraints:
1 <= T <= 100
1 <= n <= 107
0 <= Vi <= 107
Examples:
Input:
1
5
1 2 3 4 5
Output:
1 2 3 4 5
5 4 3 2 1
Given only a pointer to a node to be deleted in a singly linked list. Print the whole Linked List after deletion.
Input:
The first line of input contains an element T, denoting the no of test cases. Then T test cases follow. Each test case contains two lines. The first line of each test case contains two integers N denoting the no of elements of the linked list and P denoting the number of the node which is to be deleted (starting from 0) . Then in the next line are N space separated values of the linked list.
Output:
The output for each test case will be the space separated elements of the updated linked list.
Constraints:
1<=T<=100
2<=N<=103
0<=P<(N-1)
Example(To be used only for expected output):
Input:
2
5 2
1 2 3 4 5
4 0
1 3 6 9
Output:
1 2 4 5
3 6 9