- Notifications
You must be signed in to change notification settings - Fork2.4k
Closed
Description
Bug Report forhttps://neetcode.io/problems/binary-search
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
class Solution {
/**
*@param {number[]} nums
*@param {number} target
*@return {number}
*/
search(nums, target) {
// There is no built in function for JS.
return nums.indexOf(target);
}
}
Correction => There is a built-in function for JS.
Additional information => we can also calculate mid by this formula , which I felt more easier
let mid = Math.floor((start + end)/2);
Metadata
Metadata
Assignees
Labels
No labels