Posts on Xunxing Mao - Startups, Software Engineering, Managementhttps://maoxunxing.com/en/posts/Recent content in Posts on Xunxing Mao - Startups, Software Engineering, ManagementHugo -- gohugo.ioenSat, 08 Jul 2023 11:36:43 +0800Top 3 English Learning Tools in the Age of AIhttps://maoxunxing.com/en/how-i-learn-english/Sat, 08 Jul 2023 11:36:43 +0800https://maoxunxing.com/en/how-i-learn-english/by stable diffusion
I started learning English from primary school to university, and I believe that most university students are like me, because traditional Chinese education attaches importance to reading and comprehension of English, but basically it is dumb English.
I recalled my English learning journey, reciting the New Concept English in high school, and after I passed Grade 4 and 6 in college in one go with my high school accumulation, I never took the initiative to learn English reading again.Spelling correction for search engineshttps://maoxunxing.com/en/dynamic-lwst/Fri, 23 Jun 2023 20:46:15 +0800https://maoxunxing.com/en/dynamic-lwst/Photo by Stable Diffusion
Case Given two strings, how to quantify their similarity. This introduces the concept of “edit distance”, which is the minimum number of edits required to convert one string to another. The number of edits The lower the number of edits, the higher the similarity. Let’s say we have two strings: mitcmu and mtacnu. What is their edit distance?
Analysis One way is still to list all possibilities, achieved by a backtracking algorithm:The Double 11 Roundup Problemhttps://maoxunxing.com/en/dynamic-buy-11/Fri, 23 Jun 2023 11:26:08 +0800https://maoxunxing.com/en/dynamic-buy-11/Photo by Stable Diffusion
Case Suppose we have n items in our shopping cart (at a known price) and pick from these n items that just meet the price required for a full sale, say $200. How do we pick them? This is simplified: let’s say we have [2,2,4,6,3], an array storing the prices of the items, and our full price reduction requirement is $10.
Analysis The most conventional approach to this problem is to be able to list all the permutations and then find the item that meets the requirement.Partitioning algorithms in massive datahttps://maoxunxing.com/en/hugo-data-handle-use-dq/Sun, 18 Jun 2023 11:52:40 +0800https://maoxunxing.com/en/hugo-data-handle-use-dq/Case We have 1TB of order data that needs to be sorted by dollar size. How can we solve this problem?
Analysis This is a massive data processing problem, and the idea for this class can be through partitioning ideas, as our title says. What is partitioning? In simple terms, it means breaking down a problem into smaller, similar problems, solving each of these problems separately, and then combining the results of the smaller problems to get the final result.How to register a U.S. Apple IDhttps://maoxunxing.com/en/appleid-us-register/Sat, 27 May 2023 00:00:00 +0000https://maoxunxing.com/en/appleid-us-register/https://zhuanlan.zhihu.com/p/367821925 Original Article
The key steps are: payment method that step:
iphone General/Language and Region, change to English (US) United States; media and purchase items with your newly registered U.S. Apple ID login (select Apple Menu > “System Settings”, then tap [Your Name] at the top of the sidebar. If you don’t see your name, please tap “Sign in with your Apple ID”.
Apple official website–Log in with your newly registered U.Why You Need A Front-End Engineerhttps://maoxunxing.com/en/why-front-end-engineer/Sat, 13 May 2023 00:00:00 +0000https://maoxunxing.com/en/why-front-end-engineer/Photo by Simon Abrams on Unsplash
Front-end is a job near terminal or products.
They do a job like translation or renovation workers which transform the logic, information, and emotion of the business’s operations to each terminal (APP, browser, applet, extensions).
Create a perfect product efficiently, they need to work together with UI designer or server-side developers. However, they can do all the job by one person with AI power and modern technology tools either.Array Part 3 - Find the Largest Sum of Contiguous Subarrayhttps://maoxunxing.com/en/max-sum/Sun, 17 Apr 2022 20:44:08 +0800https://maoxunxing.com/en/max-sum/Question Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.
arr = [-2, -3, 4, -1, -2, 1, 5, -3]
OutPut: 7 Explain: 4 + -1 + -2 + 1 + 5 = 7
Code This can handle the all-negative case
// DP ? let maxSoFar = arr[0]; let maxEndingHere = arr[0]; for (let i = 1; i < arr.String Part 1 - Longest Palindromic Substringhttps://maoxunxing.com/en/substring-longest/Sat, 16 Apr 2022 23:59:19 +0800https://maoxunxing.com/en/substring-longest/Questions Given a string, find the longest substring which is a palindrome. For Example:
Input: Given string :“forgeeksskeegfor”, Output: “geeksskeeg”.
Input: Given string :“Geeks”, Output: “ee”.
Code low = index - 1; high = index + 1; // 跳掉重复 while (high < n && str[high] == str[index]) { high++; } // 跳掉重复 while (low >= 0 && str[low] == str[index]) { low--; } // 中间是回文 while (low >= 0 && high < n && str[low] == str[high]) { low--; high++; } let length = high - low - 1; if (maxLength < length) { maxLength = length; start = low + 1; } Time Complex There are two loops, the outside traverses the whole string, the inside expands from i to the outside, the worst is to expand to the beginning and the end, so the time complexity is O(n) The space is only a single variable, and the space complexity is O(1)Array Part 2 - Minimum number of jumps to reach endhttps://maoxunxing.com/en/mininumber-to-end/Sat, 16 Apr 2022 22:29:56 +0800https://maoxunxing.com/en/mininumber-to-end/Questions Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a function to return the minimum number of jumps to reach the end of the array (starting from the first element). If an element is 0, then we cannot move through that element. If we can’t reach the end, return -1. Examples:
Input: arr[] = {1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9} Output: 3 (1-> 3 -> 8 -> 9) Explanation: Jump from 1st element to 2nd element as there is only 1 step, now there are three options 5, 8 or 9.Understanding Stream in Node.jshttps://maoxunxing.com/en/nodejs-network-stream/Tue, 19 Oct 2021 14:28:57 +0800https://maoxunxing.com/en/nodejs-network-stream/Photo by Juanjo Jaramillo on Unsplash
What is a stream Streams are not only found in Nodejs, there are similar concepts in unix operating systems. For example, the pipe operation symbol
cat xx.ts | grep 'console.log' can find the corresponding matching content from the file. In fact, the concept of streams in node comes from unix systems, first from Douglas McIlroy’s concept of pipes Initial source。
Wikipedia:
Malcolm Douglas McIlroy (born 1932) is a mathematician, engineer, and programmer.How To Be Different And Successful As An Engineerhttps://maoxunxing.com/en/how-to-be-different/Wed, 06 Oct 2021 11:20:33 +0800https://maoxunxing.com/en/how-to-be-different/Photo by Jefferson Santos on Unsplash
Last week, I attended a meeting. Now I will talk about some things I learned from the meeting. A guy who will leave Alibaba Group made a talk. He is a high level engineer, he really made something successful and had a strong influence on the company.I really appreciate what learned: The way to learn things better, collaborate more efficiently with your colleague, and be more successful with your product.Array Part 1 - The maximum value of a subarray of length khttps://maoxunxing.com/en/maximum-of-all-subarrays-of-size-k/Thu, 26 Aug 2021 15:16:39 +0800https://maoxunxing.com/en/maximum-of-all-subarrays-of-size-k/Question Give an array and an integer K, find the maximum for each and every condiguous subarray of size k.
Examples:
Input: arr[] = { 1, 2, 3, 1, 4, 5, 2, 3, 6 } K = 3
Ouput: 3 3 4 5 5 5 6
Maximum of 1, 2, 3 is 3
Maximum of 2, 3, 1 is 3
Maximum of 3, 1, 4 is 4
Maximum of 1, 4, 5 is 5Graphs Part 1 - Detect Cycle in an Undirected Graphhttps://maoxunxing.com/en/detect-cycle-in-an-undirected-graph/Tue, 24 Aug 2021 00:00:00 +0000https://maoxunxing.com/en/detect-cycle-in-an-undirected-graph/Question Definition (S & T) Given an undirected graph, how to check if there is a cycle in the graph ?
Example 1:
Input：n = 4 , e = 4, the edges = { 0 1, 1 2, 2 3, 0 2 }
Output: yes
Diagram:
has circle
Example 2:
Input: n = 4, e = 3, the edges: { 0 1, 1 2, 2 3 }
Output: No
Diagram:Tree Part 2 - Given N, Find The Total Number of Unique BSTshttps://maoxunxing.com/en/find-the-total-number-of-unique-bsts-of-n/Mon, 16 Aug 2021 00:00:00 +0000https://maoxunxing.com/en/find-the-total-number-of-unique-bsts-of-n/Question Definition (S & T) Given N, Find the total number of unique BSTs that can be made using values from 1 to N
Examples:
Input: n = 3
Output: 5
For n = 3, preorder traversal of
1 2 3 1 3 2 2 1 3 3 1 2 3 2 1 Input: 4
Output: 14
Problem Analysis(A) At first, I did not quite understand what the question means. What is BST?