[LeetCode] 0371. sum of two integers
Given two integers a and b, return the sum of the two integers without using the operators + and -.
[LeetCode] 0371. sum of two integers Read More »
Leetcode, 技術文章Given two integers a and b, return the sum of the two integers without using the operators + and -.
[LeetCode] 0371. sum of two integers Read More »
Leetcode, 技術文章Given an integer array nums, find a subarray that has the largest product, and return the product.
The test cases are generated so that the answer will fit in a 32-bitinteger.
[LeetCode] 0152. Maximum Product Subarray Read More »
Leetcode, 技術文章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, 技術文章Given an array of n integers nums and an integer target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] < target.
[LeetCode] 0259. 3Sum Smaller Read More »
Leetcode, 技術文章訪者背景介紹:
1. 緯穎:伺服器驗證工程師 Machine
2. 學歷背景:四大管院研究所
3. 工作內容:針對研發單位設計出來的伺服器服務進行品質驗證、除錯並確保產品符合客戶的需求與規格,在實際運作上保持穩定性與正確性
[工程師訪談] 硬體伺服器驗證工程師經驗分享 Read More »
技術文章Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.
Return the sum of the three integers.
You may assume that each input would have exactly one solution.
[LeetCode] 0016. 3Sum Closest Read More »
Leetcode, 技術文章Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Notice that the solution set must not contain duplicate triplets
[LeetCode] 0015. 3Sum Read More »
Leetcode, 技術文章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, 技術文章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, 技術文章Given an integer array nums, find the subarray with the largest sum, and return its sum.
[LeetCode] 0053. Maximum Subarray Read More »
Leetcode, 技術文章