emerson.loureiro
BAN USER
RepSandraGabriel, Analyst at ABC TECH SUPPORT
We Data Entry Operators have a variety of duties, including processing documents, solving inconsistencies, securing information, updating databases and using ...
RepSusanHonda, Analyst at A9
I meet with clients to negotiate terms and prices on sales agreements, draw up the contract, and ensure the documents ...
RepLeenFawn, Analyst at A9
I have experience in managing all facets of front office administration, including handling multi-line phone systems, managing schedules, and maintaining ...
RepKatieKate, Developer at Amazon
Katie , a general laborer skilled in construction work, landscaping and trimming, and other commercial and residential tasks. Love to find ...
Repdawnmhodges111, abc at 247quickbookshelp
Hello I am a Web writer. All my studies complete from california.my hobby is write different type article.Right ...
RepAlizaMaurice, Applications Developer at Absolute Softech Ltd
Aliza, a photojournalist with six years of experience capturing powerful images that tell stories. Have connections with a Vashikaran Specialist ...
RepChloeKing, Accountant at A9
I like to snowboard, rock climb, and water ski. I volunteer some of my time each spring and summer to ...
RepErmanStern, Applications Developer at ADP
I am Erman . I am metal finishing-, plating- and coating-machine operators operate and monitor equipment which finishes, plates and coats ...
Repandreemsims8765, Accountant at 247quickbookshelp
AndreeSims and I am a Clinical social worker.And nowadays I am doing new research like dua to make someone ...
Repeleanormzavala63, Android Engineer at 247quickbookshelp
Hello I am a publicity agent, I have completed all my studies from Brighton. And now-a-days I am working as ...
RepLuciaLuci, Animator at Barclays Capital
I am Lucia, a Neuropsychologist in Philadelphia USA . aiming to understand how behavior and cognition are influenced by brain function ...
Repjuanitasfalbo45, Android Engineer at 247quickbookshelp
Hey, Juanita Falbo, and I am working as a Yoga instructor. And nowadays I am doing a new experiment on ...
RepOwenKary, Analyst at ASU
I am an experienced software engineer with a passion for java developing innovative programs that expedite the efficiency and effectiveness ...
Repmaryctedesco7485, Accountant at ABC TECH SUPPORT
Efficient Production Manager with 15 years of experience leading diverse manufacturing teams to create high-quality products at top speeds. Dedicated ...
RepHenryBrown, Associate at A9
I am an experienced budget analyst skilled at researching and consolidating financial and budget information. I am taught record keeping ...
RepJessicaMoss, Member Technical Staff at Bloomberg LP
Jessica , a technical writer with 5+ years of experience writing high-quality internal and user-facing support. As I love to write ...
Repterricjohnson8547, Animator at 247quickbookshelp
Hello, I am a dancer. I have completed my studies from New York. And today I am a dance teacher ...
RepLucyKaren, Android Engineer at Abs india pvt. ltd.
I am Lucy , a Web Administrator at Oshman's Throughout my professional life, I have proved my qualities multiple times ...
Repruchimosha, Analyst at Absolute Softech Ltd
My name is MaryDuncan . I am working at Crandall's Fine Furniture as a Probation officer . Here I am dealing ...
RepAtharvFlores, Accountant at A9
I am working as a position of a court clerk to assist the judges as attorneys in expediting the court ...
Replisalisajmorgan74, Animator at 247quickbookshelp
Hey, I am LisaMorgan and I am a Staff manager.I had heard a lot about Vashikaran Specialist,now I ...
RepAadenGarcia, Analyst at ADP
I have a knowledgeable professional librarian with more than 4 years of experience in the public library setting. I have ...
Repswammesha, Blockchain Developer at ADP
As a machine operator at Star Bright Investment Group it's been almost 10 years . here i learn different things ...
Repmirezwanda, Android test engineer at Arista Networks
Computer database administrator with 3+ years of experience working in Gamma Realty . I often plan security measures, making sure that ...
Replesamean618, Android Engineer at Adap.tv
Working as a Choreographer it's almost 10 years at Happy Bear Investment . Here I am dealing with different people ...
Repsuegdiaz765, Android test engineer at 247quickbookshelp
My name is Sue and I am a Specialist. We Specialist employees are responsible for specific tasks or activities in ...
RepKaiDolern, abc at 8x8
I am knowledgeable and agile legal assistant offering varied experience working as office assistant in a lawyer’s office and ...
RepEmilioOtten, Applications Developer at ASU
I am Emilio, and I am currently the Medical Interpreter at Suy bank Hospital in Ohio , where I confidentially interpret ...
Not sure this can be solved in O(n). One thing that's not entirely clear to me is whether negative numbers are allowed or not. I'm assuming that only Natural numbers are allowed. If Integers are allowed, I find it even unlikely that it can be solved in O(n). In any case, I came up with the following algorithm.
It works by keeping a hash table of size 3n, maximum space constraint allowed, where the values of the array are kept for fast search. Then it starts with a guess, by picking two random numbers, from different indices of the array, and computing the difference between then. This is the initial guess. From then on, it's basically about improving that initial guess. This works by checking the hashtable for an element "n" such that a_i - n < guess. This can be done in O(1) by searching the hashtable for the key (a_i - guess). The guess is improved by trying to find a difference of 0 first, then up until the current guess - 1. The algorithm will run quicker and quicker as it executes, as the guess will keep on getting smaller and smaller. I'm guessing that this improvement bit will run in O(cn), where "c" is related to how quick the guess goes from the initial down to the minimal. On a quick thought, I find it very unlikely that to ever get to O(n^2). So, total running time would be O((c+1)n). That'd be my guess. Comments are mostly welcome.
Space complexity is clearly O(3n).
- emerson.loureiro February 06, 2011