| 13 | |
| 14 | #Solution 1: List method |
| 15 | class Solution: |
| 16 | def addStrings(self, num1: str, num2: str) -> str: |
| 17 | s=[] |
| 18 | r=[] |
| 19 | n=len(num1) |
| 20 | m=len(num2) |
| 21 | for i in range(n): |
| 22 | s.append(num1[i]) |
| 23 | for i in range(m): |
| 24 | r.append(num2[i]) |
| 25 | res = int("".join(s)) |
| 26 | res1 = int("".join(r)) |
| 27 | ans=res+res1 |
| 28 | return str(ans) |
| 29 | |
| 30 | #solution 2: (elementary math(carry method)) |
| 31 | class Solution: |
nothing calls this directly
no outgoing calls
no test coverage detected