i converted the array to an integer and added 1 to it ,but then while trying to do i discovered typescripts number can not support more than 17 numbers and it looses its precison. so i used BigInt which lets me keep large numbers ensuring numerical precision is preserved for large values and converted the integer back to an array
- Time complexity: O(N)