Given a non-negative integer represented as an array of digits. Your task is to add 1 to the number ( increment the number by 1). The digits are stored such that the most significant digit is at the starting index of the array.

**Example:**

If the array has [4, 5, 6], the resultant array should be [4, 5, 7] as 456 + 1 = **457**.

**Input:**

The first line of input contains an integer **T** denoting the number of test cases. The first line of each test case contains a single integer N denoting the size of the array. The second line contains **N** space-separated integers **A _{1}**,

**Output:**

Print the resultant array.

**Constraints: **

1 ≤ T ≤ 300

1 ≤ N ≤ 10^{7}

0 ≤ A[i] ≤ 9

**Example: **

**Input:**

2

4

5 6 7 8

3

9 9 9

**Output:**

5 6 7 9

1 0 0 0

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.

the_coder95 | 465 |

thanuvinu94 | 384 |

ShivayLamba | 256 |

adityasuman2025 | 249 |

PrakharBansal1 | 236 |

the_coder95 | 1691 |

RishabhTanwar1 | 1110 |

thanuvinu94 | 1060 |

samay_kam_hai | 724 |

themanhasnoname | 620 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4897 |

Quandray | 4547 |

Login to report an issue on this page.