MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / Solution

Class Solution

LeetCode_problems/Add Strings/solution.cpp:1–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Solution {
2public:
3 string addStrings(string num1, string num2) {
4 return to_string(std::stoi(num1)+std::stoi(num2));
5 // std::stoi is used to convert string to int (default is decimal, but the base can also be defined as a second parameter)
6 // to_string converts int to string
7 }
8};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected