Title: Day 18 q2: Search in Rotated Sorted Array · Issue #409 · SnowScriptWinterOfCode/LeetCode_Q · GitHub
Open Graph Title: Day 18 q2: Search in Rotated Sorted Array · Issue #409 · SnowScriptWinterOfCode/LeetCode_Q
X Title: Day 18 q2: Search in Rotated Sorted Array · Issue #409 · SnowScriptWinterOfCode/LeetCode_Q
Description: There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k...
Open Graph Description: There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) ...
X Description: There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.le...
Opengraph URL: https://github.com/SnowScriptWinterOfCode/LeetCode_Q/issues/409
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Day 18 q2: Search in Rotated Sorted Array","articleBody":"There is an integer array `nums` sorted in ascending order _(with distinct values)_.\r\n\r\nPrior to being passed to your function, `nums` is **possibly rotated** at an unknown pivot index `k` (`1 \u003c= k \u003c nums.length`) such that the resulting array is `[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]` (**0-indexed**). \r\nFor example, `[0,1,2,4,5,6,7]` might be rotated at pivot index `3` and become `[4,5,6,7,0,1,2]`.\r\n\r\nGiven the array `nums` after the possible rotation and an integer `target`, return the **index** of `target` if it is in `nums`, \r\nor **-1** if it is not in `nums`.\r\n\r\nYou must write an algorithm with `O(log n)` runtime complexity.\r\n\r\n**_Example 1:_**\r\n\r\n**Input**: `nums` = [4,5,6,7,0,1,2], `target` = 0\r\n**Output**: 4\r\n\r\n**_Example 2:_**\r\n\r\n**Input**: `nums` = [4,5,6,7,0,1,2], `target` = 3\r\n**Output**: -1\r\n\r\n**_Example 3:_**\r\n\r\n**Input**: `nums` = [1], `target` = 0\r\n**Output**: -1\r\n \r\n\r\n**Constraints:**\r\n\r\n- 1 \u003c= `nums`.length \u003c= 5000\r\n- -10^4 \u003c= nums[i] \u003c= 10^4\r\n- All values of nums are unique.\r\n- `nums` is an ascending array that is possibly rotated.\r\n- -10^4 \u003c= `target` \u003c= 10^4\r\n\r\n`question link`: https://leetcode.com/problems/search-in-rotated-sorted-array/","author":{"url":"https://github.com/sumiranverma","@type":"Person","name":"sumiranverma"},"datePublished":"2024-01-14T17:52:46Z","url":"https://github.com/SnowScriptWinterOfCode/LeetCode_Q/issues/409"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c4b9a4de-b5be-b4fa-fd33-0c950be6e01b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B048:DCDA8:1E1FB5C:26CF868:6AFFCE87 |
| html-safe-nonce | 864fdeacf6b405eef64255212a6b8800d24d331791f5c3cafa076bba557f9577 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDQ4OkRDREE4OjFFMUZCNUM6MjZDRjg2ODo2QUZGQ0U4NyIsInZpc2l0b3JfaWQiOiI0Nzg0NTU3OTI1NjA1NTU5OTQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 75400e3634d51e0e478620dcfb9df58d6c83557145fe157f5626de0b2c4406ce |
| hovercard-subject-tag | issue:2080831607 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/SnowScriptWinterOfCode/LeetCode_Q/409/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8786ad4dbc1acdf5d93baadffb950f71324cae34449eecd4e51d7314f8026cae/SnowScriptWinterOfCode/LeetCode_Q/issues/409 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8786ad4dbc1acdf5d93baadffb950f71324cae34449eecd4e51d7314f8026cae/SnowScriptWinterOfCode/LeetCode_Q/issues/409 |
| og:image:alt | There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sumiranverma |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/SnowScriptWinterOfCode/LeetCode_Q git https://github.com/SnowScriptWinterOfCode/LeetCode_Q.git |
| octolytics-dimension-user_id | 154897622 |
| octolytics-dimension-user_login | SnowScriptWinterOfCode |
| octolytics-dimension-repository_id | 735947375 |
| octolytics-dimension-repository_nwo | SnowScriptWinterOfCode/LeetCode_Q |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 735947375 |
| octolytics-dimension-repository_network_root_nwo | SnowScriptWinterOfCode/LeetCode_Q |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width