You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Find All Numbers Disappeared in an Array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/findDisappearedNumbers/index.js)| Easy |
|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/maxProfit/index.js)| Easy |
15
-
|[Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/sumRange/index.js)| Easy |
|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/hasCycle/index.js)| Easy |
18
-
|[Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/middleNode/index.js)| Easy |
|[Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/runningSum/index.js)| Easy |
|[N-ary Tree Preorder Traversal](https://leetcode.com/problems/n-ary-tree-preorder-traversal/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/preorder/preorder.js)| Easy |
31
-
|[Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/description/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/detectCycle/detectCycle.js)| Medium |
|[Find All Numbers Disappeared in an Array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/findDisappearedNumbers/index.js)| Easy |
|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/maxProfit/index.js)| Easy |
15
+
|[Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/sumRange/index.js)| Easy |
|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/hasCycle/index.js)| Easy |
18
+
|[Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/middleNode/index.js)| Easy |
|[Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/runningSum/index.js)| Easy |
|[N-ary Tree Preorder Traversal](https://leetcode.com/problems/n-ary-tree-preorder-traversal/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/preorder/preorder.js)| Easy |
31
+
|[First Bad Version](https://leetcode.com/problems/first-bad-version/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/findFirstBadVersion/findFirstBadVersion.js)| Easy |
|[Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/description/)|[Solution](https://github.com/GolubevDS/LeetCodePatterns/blob/main/solutions/detectCycle/detectCycle.js)| Medium |
Given an array of integers `nums` which is sorted in ascending order, and an integer `target`, write a function to search `target` in `nums`. If `target` exists, then return its index. Otherwise, return `-1`.
4
+
5
+
You must write an algorithm with `O(log n)` runtime complexity.
## [278. First Bad Version](https://leetcode.com/problems/first-bad-version/)
2
+
3
+
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
4
+
5
+
Suppose you have `n` versions `[1, 2, ..., n]` and you want to find out the first bad one, which causes all the following ones to be bad.
6
+
7
+
You are given an API `bool isBadVersion(version)` which returns whether `version` is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.
0 commit comments