Given two linked lists that represents two large positive numbers. The task is to subtract the given two numbers represented by the linked list. Subtract the smaller from the larger one.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer **N** denoting the size of the first linked list (L1) In the next line are the space separated values of the first linked list. The third line of each test case contains an integer **M** denoting the size of the second linked list (L2). In the forth line are space separated values of the second linked list.

**Output:**

For each test case output will be space separated values of the resultant linked list.

**User Task:**

The task is to complete the function **subLinkedList**() which should subtract the numbers represented by the linked list.

**Constraints:**

1 <= T <= 100

1 <= N, M <= 10000

**Example:**

**Input:**

1

3

1 0 0

2

1 2

**Output:**

8 8

**Explanation:
Testcase 1:** 12 subtracted from 100 gives us 88 as result.

Author: Shubham Joshi 1

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

saiujwal13083 | 489 |

sudeep235poojary | 302 |

VithalNakod | 272 |

AshutoshPal1 | 254 |

go__karuna | 253 |

Soseph_Jtalin | 792 |

AshutoshPal1 | 722 |

architjindal__ | 648 |

go__karuna | 577 |

ArbazGrewal | 527 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4931 |

Quandray | 4598 |

Login to report an issue on this page.