Xian (Shawn) Li's Blog

Fortune Favors the Bold.

[LeetCode] #852 - Peak Index In A Mountain Array

"Leetcode Solutions in Python"

Problem: Peak index in a mountain array Let’s call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < ...

[LeetCode] #350 - Intersection Of Two Arrays 2

"Leetcode Solutions in Python"

Problem Intersection of Two Arrays 2 Given two arrays, write a function to compute their intersection. Example 1: ​ Input: nums1 = [1,2,2,1], nums2 = [2,2] ​ Output: [2,2] Example 2: ​ Input...

[LeetCode] #349 - Intersection Of Two Arrays

"Leetcode Solutions in Python"

Problem Intersection of Two Arrays Give two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Ouptut: [2] Example 2: Input: nums1 = [...

[LeetCode] #167 - Two Sum 2

"Leetcode Solutions in Python"

Problem: Two Sum 2 - Input array is sorted Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function ...

[LeetCode] #1064 - Fixed Point

"Leetcode Solutions in Python"

Problem Fixed Point Given an array A of distinct integers sorted in ascending order, return the smallest index i that satisfies A[i] == i. Return -1 if no such i exists. Example 1: Input: [-10...

Test My First Post on This Blog

"Posting Test"

Test - Header 1 Try to type some words here. Test - Header 2 Test - Header 2.1 Hello World! test - header 2.1.1 Xian Li Insert some words here. Here it shows some picture of iPhone XR, XS, XS Ma...