Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string.
You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly.
Here is My code:
/**
* @param {string} num1
* @param {string} num2
* @return {string}
*/
var addStrings = function(num1, num2) {
var num1Int = parseInt(num1);
var num2Int = parseInt(num2);
var sum = num1Int + num2Int;
var sumString = sum.toString();
return sumString;
};
console.log(addStrings("11", "123"));