sai
BAN USER- 9of 9 votes
AnswersGiven an array of integers, find all combination of four elements in the array whose sum is equal to a given value X.
- sai in India
For example, if the given array is {10, 2, 3, 4, 5, 9, 7, 8} and X = 23, then your function should print “3 5 7 8″ (3 + 5 + 7 + 8 = 23).| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersTwo trains enter at the opposite sides of a tunnel of length L with speeds 'V'. A particle enters the tunnel at the same time with a speed 'v' and it vibrates in the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the position of the particle by the time the 2 trains meet?
- sai in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Probability Algorithm
algorithm :
1. sort the array - O(nlogn)
2. Find the range of the sum. at worst case the whole array - O(n)
3. subtract 3 number from the sum and do binary search on the other array elements.
4. if the value is found, print and continue for the other combinations
step 3 and 4 together takes - O(nlogn)
therefore total time complexity is O(nlogn)+O(n)+O(n^2logn) = O(nlogn)
RepPearlBenda, Associate at Accenture
I am Pearl , a Power Plant Operator with in-depth knowledge of all aspects of operation and maintenance and 9 years ...
RepColaraJoshi, Floor manager at Thomes
By profession, I am Floor manager in the Thomes store. I am passionate about astrology and read tronto cards, horoscopes ...
RepEllaWilliams, Analyst at A9
I am a perceptive systems analyst adept at designing innovative IT solutions and enhancing existing systems with new features. I ...
RepDaisyDiaz, abc at ADP
I am enthusiastic professional writer with years of experience in writing articles for magazines and newspaper, very dependable and has ...
RepCandiRoy, HR at ASU
I am a qualified CEO with experience in overseeing the daily activities of small businesses and large corporations alike. I ...
RepBarbaraLocke, Android test engineer at ABC TECH SUPPORT
Hey, I'm a BarbaraLocke. And I love my work. Apart from this, I am doing some new experiments in ...
RepMinnieRuffin, Accountant at Boomerang Commerce
Minnie , a business leader professional accustomed to managing projects with Vashikaran Specialist in nagpur pay after results with fast-paced and ...
RepNaomiAdams, abc at 8x8
Passionate educator for nearly 5 years with a strong desire to help students recognize the connection between learning and experience ...
Reprajanadeep17, Android Engineer at 247quickbookshelp
I am a Special education teacher who adapts general education lessons and teaches various subjects to students with mild to ...
RepWandaScales, Applications Developer at Aspire Systems
I am a Medical writer in the Just For Feet company . I enjoy spells for making someone obsessed with you ...
Repddmohsi890, Associate at Abs india pvt. ltd.
Working as a Photographic processing machine operator at Cardinal Stores for almost 10 years . I have lots of experience in ...
RepLilyBell, Accountant at 8x8
I am a creative and dedicated photo editor with experience in photojournalism and marketing material development. I have a proven ...
RepSaanviJones, abc at 8x8
I am working as an office worker in a softage company. I am responsible for an office assistant position in ...
RepRenitaLoius, Digital marketing freshers at Amdocs
Renita , a marketing writer with a comprehensive background of achievements in providing marketing advice to clients, writing original articles on ...
Repjaynebackus, Applications Developer at Achieve Internet
I am Jayne And I am working as a Record center clerk in a company. Also I'm doing a ...
Repsushiswla65, Area Sales Manager at ABC TECH SUPPORT
My name is SarahProctor . I am working as a Video editor at Konsili . I am exploring some magical tricks . vashikaran ...
RepNoraMiller, abc at A9
Confident and dedicated photographer with experience in both professional and freelance photography.. Prioritizes communication on the job to avoid errors ...
RepRianaHudge, Integration Software Engineer at Autoportal.com
Riana , a caring and compassionate Home Health Aide with more than 7 years of experience in providing daily living and ...
RepAnnetteOwens, Email Customer Service at Axiom Sources
Hi , I am Annette, a Data Processor with a comprehensive knowledge of data management and analysis. As I am a ...
RepKaiDolern, abc at 8x8
I am knowledgeable and agile legal assistant offering varied experience working as office assistant in a lawyer’s office and ...
Repcheryljnewsome, Android Engineer at ABC TECH SUPPORT
Hello, my name is Chery and I am a Graphic designer. We are Graphic Designers create visual concepts to communicate ...
Repracheljennir, Personnel consultant at Infinite Wealth
Rachel, I am a Personnel consultant who acts as mediator between employers and job seekers. The main task of I ...
Repzkate584, Android test engineer at 247quickbookshelp
Zara , a Publisher with a record of extraordinary achievements in increasing sales and circulation, discovering and launching new books and ...
RepFernBryant, Android Engineer at ABC TECH SUPPORT
I FernBryant working at Naugles as a Financial consultant . I have 5 years of experience . I also guide people regarding ...
Think step 2 is not required
- sai September 04, 2012