This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The gist has recursive binary search, but the exact same logic and math rules apply to iterative algorithms as well. | |
| import "errors" | |
| // --------------------------------------------------------- | |
| // Type A | |
| // Should return the index of the exact match. | |
| // If there are duplicates, it will return the index of whichever one it finds first. | |
| // --------------------------------------------------------- |