<commit_before>import unittest
from typing import List

import utils


class Solution:
    def search(self, nums: List[int], target: int) -> int:
        lo = 0
        hi = len(nums) - 1

        while lo <= hi:
            mid = lo + ((hi - lo) >> 1)
            mid_val = nums[mid]

            if target == mid_val:
                return mid

            lo_val = nums[lo]
            hi_val = nums[hi]<commit_msg>33. Search in Rotated Sorted Array<commit_after>import unittest
from typing import List

import utils


# O(log(n)) time. O(1) space. Binary search.
class Solution:
    def search(self, nums: List[int], target: int) -> int:
        lo = 0
        hi = len(nums) - 1

        while lo <= hi:
            mid = lo + ((hi - lo) >> 1)
            mid_val = nums[mid]

            if target == mid_val:
                return mid

            lo_val = nums[lo]
            hi_val = nums[hi]
{'fraction_non_alphanumeric': 0.10951327433628319, 'fraction_numerical': 0.00995575221238938, 'mean_word_length': 1.5931232091690544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5964477', 'n_tokens_mistral': 303, 'n_tokens_neox': 286, 'n_words': 92}