Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchInRotatedSortedArray Invalid Solution #122

Closed
nitesh619 opened this issue May 12, 2019 · 4 comments
Closed

SearchInRotatedSortedArray Invalid Solution #122

nitesh619 opened this issue May 12, 2019 · 4 comments

Comments

@nitesh619
Copy link

Doen's work for below Input:
[1,1,3,1]
3

Expected: 2
Actual: -1

@joimxjtuse
Copy link

i think you have not realize the premise:
“an array sorted in ascending order”.

@Walshf0411
Copy link

It is said in the first line of the code that, yoy may assume no duplicates occur in the array. So i guess the code does not work for duplicates.

@joimxjtuse
Copy link

your arr should be : [1, 1, 1, 3], while you search "1", it may not the right position what you want.

@nitesh619
Copy link
Author

You are right, no duplicates are allowed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants