// Main problem I could not write the main() function myself
// if anyone had done main, please reply here
class Solution // why do we need class
{
public:
vector twoSum(vector &nums, int target) // &num '&' why need this, I know that it takes address of a value, but how it works here
{
vectorresult;
for (int i = 0; i <= nums.size()-1; i++)
{
for (int j = 0; j <= nums.size()-1; j++)
{
if ((i!=j) && nums[i]+nums[j] == target)
{
result.push_back(i);
result.push_back(j);
return result;
}
}
}
return nums;
}
};