Comments (1)

Followers (2)

Reputation 20

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Similar Question

A zero indexed array A consisting of N integers is given. A triplet (P,Q,R) is called a triangle if 0<=P<Q<R<N and

- A[P] + A[Q] > A[R]

- A[Q] + A[R] > A[P]

- A[R] + A[P] > A[Q]

The perimeter of such a triangle equals A[P] + A[Q] + A[R].

For example A is {10,2,5,1,8,20}

Triplet(0,2,4) is a triangle and its perimeter 10+5+8 = 23. There is no any other triangle with a larger perimeter.

Write a function that given a zero indexed array A of N integers, returns the maximum perimeter of any triangle in this array. The function should return -1 if there are no triangles.

- alikatkar January 01, 2015