Below code is running fine on code blocks but giving error on leetcode platform. Why ?
error :- use of undeclared identifier 'Solution' vector ret = Solution().twoSum(param_1, param_2); return ret;
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,target;
cout<<"enter size of array"<<endl;
cin>>n;
int *nums = new int[n];
cout<<"enter elements in array"<<endl;
for(int i=0;i<n;i++){
cin>>nums[i];
}
cout<<"enter target"<<endl;
cin>>target;
for(int j=0;j<n;++j){
int x,c;
c=1;
x=nums[j];
while((x+nums[j+c])!=target){
++c;
}
if((j+c)<=(n-1))
cout<<'['<<j<<','<<' '<<j+c<<']';
}
}