ronnie.alonso
BAN USER
I use hash map to record the sum of two pair and find two pairs which has the same sum. Time is O(n^2)
struct Node
{
int x;
int y;
Node(int a=0, int b=0):x(a),y(b){};
};
vector<int> Print4Sum(vector<int> A){
int tsum, l = A.size();
vector<int> ans;
if (l < 4) return ans;
map<int, Node> hashmap;
for (int i = 0; i < l-1; ++i)
for (int j = i+1; j < l; ++j)
{
tsum = A[i] + A[j];
if (hashmap.find(tsum) == hashmap.end()){
Node tnode = Node(i,j);
hashmap[tsum] = tnode;
}else{
Node tnode = hashmap[tsum];
int x = tnode.x, y = tnode.y;
if (x != i && x != j && y != i && y != j)
{
ans.push_back(i);
ans.push_back(j);
ans.push_back(x);
ans.push_back(y);
sort(ans.begin(), ans.end());
return ans;
}
}
}
return ans;
}
RepCorrinaAyala, Field Sales at Coupondesh
Corrina, works as a Training and development manager. The Training and Development Manager is responsible for improving the productivity of ...
Repmarkhmitchell6, Analyst at ASAPInfosystemsPvtLtd
At first, tattooing was a hobby kind of thing for me. I didn’t spend too much time in tattoo ...
RepLisaTQuinn, Analyst at A9
I have a passion for reading and creative writing and attend many workshops and conventions surrounding love spell that work ...
RepAvyuktBurk, photographer at Precious Moments
Confident and dedicated photographer with experience in both professional and freelance photography. I like to explore Black Magic Spell To ...
Repsherykasper, Accountant at A9
Bonjour, je travaille dans une entreprise en tant que caissier. J'habite à Maysville mais je suis en fait d ...
RepEllaFlores, Associate at Alcatel Lucent
Ella , a Tour bus driver in Sounds Great company Inc. A charter bus driver is responsible for providing comfortable and ...
Repjosiredhima, AT&T Customer service email at Aricent
I am an architect with three years experience planning and designing commercial buildings. I am working as principal architect on ...
Repkayegoinsk, Cloud Support Associate at ABC TECH SUPPORT
Hello, I'm Kim Starns. I work as a Telephone service representative at the respected Sholl's Colonial Cafeteria. Part ...
Repanitajmiller3, Android test engineer at ADP
Je suis passionnée par le monde du marketing de marque. Je souhaite explorer Comment faire revenir l etre aimé avec ...
Repannawellson007, Area Sales Manager at 8x8
Hey my name is anna And i am working as a content writer in Search engine optimization company.My component ...
RepRuthMitchell, Applications Developer at ASAPInfosystemsPvtLtd
My name is Mitchell working as a technical sales support worker in the USA. I identify and establish new business ...
RepGlennPCannon, Applications Developer at Techlogix
Hi everyone, I am a professor in Houston, USA. I like to explore new things about Hire Someone To Break ...
Replyndaander9, Analyst at A9
My name is Anderson and I am a 24 years old trader born and currently working in New York, USA ...
Repshirleyjbarker439, Animator at ASAPInfosystemsPvtLtd
Hello, I am Gladys. I am a Industrial Photographer. I started off my photographic career as a News photographer based ...
Repthelmasaraht, Applications Developer at Accolite software
A child protection social worker is responsible for a variety of services designed to help families and children in a ...
Repman254183, Project Leader at GoDaddy
I am working as Human Resources Associates, and my duties are for obtaining, recording, and interpreting human resources information within ...
RepRobin has more than 26 years of experience working for state, city, university, and public entities as a fisheries ecologist ...
Replarryehickl, Associate at ABC TECH SUPPORT
I am a blogger in the Geek system operator . As an editor with a strong background in english and hindi ...
Repcherylbgrant, Python Experienced at Bankbazaar
Je suis Cheryl, une traductrice multilingue passionnée avec 3 ans d'expérience dans la traduction de différentes langues telles que ...
RepRileyAllen, Analyst at British Telecom
I enjoy spending my spare time outside and engaging in activities such as hiking, swimming, biking, and jogging. Explore new ...
RepHey, I am Margaret Salas, and I am working as a Web Developer Manager. And nowadays I am doing a ...
RepSuzaneVenable, Applications Developer at 247quickbookshelp
I am an employment manager typically in charge of planning the hiring processes, setting guidelines and timelines, and establishing budgets ...
RepLizaZeiger, Animator at Accenture
I am a Loan processing clerk. My work is assembling, administering and processing your loan application paperwork before it gets ...
RepGenesisCruz, Integration Software Engineer at NetApp
I am a highly professional and experienced board director with many years of experience leading non-profit as well as for-profit ...
Replisachndi, Backend Developer at Adjetter Media Network Pvt Ltd.
I am the manager of health services. I work in managing medical and health services in hospitals, community health institutions ...
Rephelenweiver, Consultant at ASU
I am Helen , policy analyst at Sunflower Market , with 3 years of experience building and maintaining relationships with elected officials ...
Repsylviatobins, Applications Developer at 247quickbookshelp
Hi, I am Sylvia Law librarian. I am an information resource expert. I work in law schools, corporate law departments ...
Repteresawells858, Java Developer at 247quickbookshelp
I am Teresa. I work as a Software engineer at Asian Fusion Company. I was born in the US and ...
DP problem, just check the previous 1 and 2 numbers are valid or not;
- ronnie.alonso October 13, 2014