Hogan

I graduated from Chengdu University of Electrical Engineering and am currently working as a foreign product engineer. My job content is related to full-end software development and mobile app development. Mainly sharing some program code, software teaching, and experience exchange. Instagram : hogan.tech

[LeetCode] 0011. Container With Most Water

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).

Find two lines that together with the x-axis form a container, such that the container contains the most water.

Return the maximum amount of water a container can store.

Notice that you may not slant the container.

[LeetCode] 0011. Container With Most Water Read More »

Leetcode, Technical Article
ExperienceSharing01

[Engineer Interview] Hardware server verification engineer experience sharing

Visitor background introduction:
1. Wiwynn: Server Verification Engineer Machine
2. Academic background: Graduate School of the Four Major Management Schools
3. Job content: Conduct quality verification and debugging of server services designed by the R&D unit to ensure that the products meet customer needs and specifications, and maintain stability and correctness in actual operations.

[Engineer Interview] Hardware server verification engineer experience sharing Read More »

Technical Article
Search in Rotated Sorted Array

[LeetCode] 0033. Search in Rotated Sorted Array

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], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums [k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0, 1,2]. Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums. You must write an algorithm with O(log n) runtime complexity.

[LeetCode] 0033. Search in Rotated Sorted Array Read More »

Leetcode, Technical Article
find minimum in rotated sorted array

[LeetCode] 0153. find minimum in rotated sorted array

Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become:

[4,5,6,7,0,1,2] if it was rotated 4 times.
[0,1,2,4,5,6,7] if it was rotated 7 times.

Notice that rotating an array [a[0], a[1], a[2], …, a[n-1]] 1 time results in the array [a[n-1], a[0], a [1], a[2], …, a[n-2]].

Given the sorted rotated array nums of unique elements, return the minimum element of this array.

You must write an algorithm that runs in O(log n) time.

[LeetCode] 0153. find minimum in rotated sorted array Read More »

Leetcode, Technical Article