Update divide_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Swastika Gupta
2021-08-05 23:51:51 +05:30
committed by GitHub
parent bbea4ad07d
commit 8cdc916eb2

View File

@@ -69,8 +69,9 @@ std::string addStrings(std::string first, std::string second) {
(firstBit & carry); // sum of 3 bits
}
if (carry)
if (carry) {
result = '1' + result; // adding 1 incase of overflow
}
return result;
}
/**