Comments (2)
I find this solution to be easy:
Sort(A)
candidate = 1
for i from 1 to length(A):
if A[i] > candidate: return candidate
else: candidate = candidate + A[i]
return candidate
First solution is crazy. 🔢 will look into it and let u know.
from interview-questions.
I can also understand this. The challenge is to do it in less than O(n lgn). O(n) solution needed
from interview-questions.
Related Issues (20)
- Interesting Dyn. Pgming question
- can you add more comments to the individual functions, I dont understand what is happening HOT 4
- Place questions in seperate folder named Questions HOT 3
- REDO the topcoder repo HOT 2
- Typo HOT 6
- Url shortener doesnt have any OO design. It just seems like a problem being solved. HOT 3
- Wiki basic questions has more java specific questions !! HOT 3
- Rename all the links in wiki since the model has been changed HOT 1
- Finish the TODO
- Do Array and string folder be named as 01?? HOT 2
- Add questions from here HOT 1
- Add this qn
- BST to Double linked list
- add to readme HOT 5
- Trees and graphs has as extra src folder. HOT 3
- Where can i add the link for competitive programming? HOT 1
- Add team blind's curated list
- Add max-consecutive-ones-iii question
- Add new Amazon SDE-1 questions from leetcode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interview-questions.