<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Roy Wang on Medium]]></title>
        <description><![CDATA[Stories by Roy Wang on Medium]]></description>
        <link>https://medium.com/@roywannago?source=rss-ba3ef4ed6348------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DN6WxBZjqIH4tvi3iErjbA.jpeg</url>
            <title>Stories by Roy Wang on Medium</title>
            <link>https://medium.com/@roywannago?source=rss-ba3ef4ed6348------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 15:10:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@roywannago/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[生產力｜如何開始使用Notion：生活更有秩序的第一步]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E7%94%9F%E7%94%A2%E5%8A%9B-%E5%A6%82%E4%BD%95%E9%96%8B%E5%A7%8B%E4%BD%BF%E7%94%A8notion-%E7%94%9F%E6%B4%BB%E6%9B%B4%E6%9C%89%E7%A7%A9%E5%BA%8F%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5-d5fb2a9f7d1d?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fb2a9f7d1d</guid>
            <category><![CDATA[notion-template]]></category>
            <category><![CDATA[工作]]></category>
            <category><![CDATA[notion]]></category>
            <category><![CDATA[生產力]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Thu, 05 Oct 2023 02:04:38 GMT</pubDate>
            <atom:updated>2023-10-05T02:04:38.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mbeBdJmE19-fj06k" /></figure><p>身為一個生活亂七八糟又忘東忘西的人，我數不清有無數次在散落各處的筆記跟app中找到自己的隻言片語，「原來我有想過要做這件事啊！」「啊！原來之前的我就想過這麼酷的點子」，如果你跟我一樣健忘，想尋求一個第二大腦來幫你記住重要又轉瞬即逝的想法，那歡迎跟我一起加入使用 Notion 的行列！</p><h3>Notion：你的第二大腦</h3><p>想像Notion就像是一個魔法寶箱，裡面有各種魔法道具，可以幫助你把生活大小事變得更輕鬆，讓你重新掌握生活的秩序感。他不僅可以幫你紀錄下重要事項、整理各種資訊、發揮創意、寫下對未來的想像、計畫重要的旅行，更像是一個寶藏地圖，幫助你找到需要的資訊。善用Notion這個神器，能幫我們更好的計劃時間，這樣一來，能把更多時間放在真正重要的事情上，重建生活的秩序感。這篇文章我會教你如何開始使用Notion，免費且在五分鐘內能完成。</p><h3>第一步：進入 Notion 官方網站</h3><p>用電腦或手機打開瀏覽器，進入Notion的官網 <a href="https://www.notion.so/">notion.so</a>，你就會看到一個大大的「Sign up」按鈕。就是這麼簡單粗暴。</p><p>喜歡用APP的朋友，也可以在蘋果的App Store、或是安卓Play商店免費下載 Notion。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*B_mwL6nYhJa-ZgFoXgURbw.png" /><figcaption>Notion登陸頁面</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsAZy9VlUIx8a5L-XCtVdw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8gSYfh4ZeW-JGjjCHHyzQ.jpeg" /><figcaption>iOS版的Notion</figcaption></figure><h3>第二步：填寫Email</h3><p>接下來會出現一個讓你填email的界面。輸入你的email之後，按「Send Magic Link」。接著，Notion會寄一個驗證連結到你的電子信箱。</p><p>如果懶得記帳號密碼的朋友，也可以用Google帳號、或是Apple的ID直接註冊，之後就用同樣的帳號就可以登入。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*VyPZQMjfH2f55yof97cS6g.png" /><figcaption>Notion的註冊頁面</figcaption></figure><h3>第三步：驗證Email</h3><p>接下來到你的信箱點開連結，你就會回到 Notion 的網站，你的帳號就差不多完成了！或是你也可以複製他給的一串註冊碼，回到原本的頁面貼上 Sign up code，接著按下 Create new account 註冊帳號。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSh6iU7GmXuyevPSThG6_Q.png" /><figcaption>到你的信箱點magic link完成註冊</figcaption></figure><h3>第四步：設定帳戶資訊</h3><p>回到網站後，他會讓你輸入帳戶名稱和密碼。設定好後，恭喜你，你現在就是Notion的正式用戶了！帳戶名稱之後還可以更改，不需要太擔心。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*aRwQWxTxF2FfwDJI-2Xj1A.png" /></figure><h3>第五步：完成設定</h3><p>登入後，Notion會讓你選擇你的使用目的，是For團隊、個人使用、還是課業相關的，按照自己的情況自由選擇就可以。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*qjbMWgni1s1ZN1NRXGjWNw.png" /></figure><h3>恭喜你註冊完成！</h3><p>最後，Notion會讓你選一個模板來開始。有行事曆、筆記，甚至是個人網站等等！選一個你喜歡的就開始吧！歡迎進入Notion的魔法空間！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*T2a7EGgm0WX_znaxuHo6kg.png" /></figure><p>到了這一步可以花些看看Notion提供的初始模板跟基本操作，左邊是Pages，左上角名字’s Notion是你的Workspace工作站的名稱，免費版可以有一個Workspace。如果不喜歡他提供的模板，也可以放心把所有的Page刪掉自己重新開始。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLe4XjLc9Oez-Js1AXPAVQ.png" /></figure><h3>結語</h3><p>恭喜你，你已經完成了Notion帳戶的註冊與基本設定，接下來就是無窮無盡的可能等著你去探索。不論是學習、工作還是日常生活管理，Notion都可以是你最可靠的助手。</p><p>你已經邁出了重建生活秩序的第一步，是時候讓Notion成為你最佳的第二大腦。從今天起，別再讓那些偉大的點子或重要的任務在繁忙和混亂中消失。接下來，我也會繼續與大家分享一些我自製的實用Notion模板，歡迎大家互相交流學習！</p><p>最後，謝謝你花時間讀這篇文章，希望你也能跟我一樣，用Notion找回生活的秩序和心頭的那塊寧靜。期待下次見面！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fb2a9f7d1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E7%94%9F%E7%94%A2%E5%8A%9B-%E5%A6%82%E4%BD%95%E9%96%8B%E5%A7%8B%E4%BD%BF%E7%94%A8notion-%E7%94%9F%E6%B4%BB%E6%9B%B4%E6%9C%89%E7%A7%A9%E5%BA%8F%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5-d5fb2a9f7d1d">生產力｜如何開始使用Notion：生活更有秩序的第一步</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜56. Merge Intervals (Medium)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-56-merge-intervals-medium-ef06525b3f6a?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef06525b3f6a</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Sun, 20 Dec 2020 13:38:45 GMT</pubDate>
            <atom:updated>2023-10-05T02:02:02.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8wgina2HRhzQxzQW2wCBQ.png" /></figure><h3>Merge Intervals</h3><p>Link: <a href="https://leetcode.com/problems/merge-intervals/">https://leetcode.com/problems/merge-intervals/</a></p><h4>Question:</h4><p>Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return <em>an array of the non-overlapping intervals that cover all the intervals in the input</em>.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> intervals = [[1,3],[2,6],[8,10],[15,18]]<br><strong>Output:</strong> [[1,6],[8,10],[15,18]]<br><strong>Explanation:</strong> Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> intervals = [[1,4],[4,5]]<br><strong>Output:</strong> [[1,5]]<br><strong>Explanation:</strong> Intervals [1,4] and [4,5] are considered overlapping.</pre><p><strong>Constraints:</strong></p><ul><li>1 &lt;= intervals.length &lt;= 104</li><li>intervals[i].length == 2</li><li>0 &lt;= starti &lt;= endi &lt;= 104</li></ul><h3>Answers</h3><h4>想法</h4><ol><li>先將區間以 start point 大小排序</li><li>掃描所有區間的起始點</li><li>如果一開始答案為空，直接把現在的interval array push 到答案</li><li>或現在的區間 start point 比答案區間的 end point 大，表示沒有交集，開始一個新的 interval ，並 push 到答案</li><li>Else, 表示不為空且有交集的話，把答案的結束點更新到兩者之間較大的 end point</li></ol><h4>Javascript 程式碼</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62a602cff4e34669479c080c9da5de6a/href">https://medium.com/media/62a602cff4e34669479c080c9da5de6a/href</a></iframe><h4>實際走一遍</h4><pre>[[1,3],[2,6],[8,10],[15,18]]</pre><p>以起始點排序之後</p><pre>[[1,3],[2,6],[8,10],[15,18]]</pre><p>第一輪：curr_interval = [1,3], ans = []</p><p>因為 ans 沒東西，直接把 curr_interval push 到裡面：ans = [[1,3]]</p><p>第二輪：curr_interval = [2,6], ans = [[1,3]]</p><pre>curr_interval[0] = 2 &lt; ans[ans.length-1][1] = 3 </pre><p>表示有重合，可以合併，6 &gt; 3, 把 ans 的 endpoint 更新到 6：ans = [[1,6]]</p><p>第三輪：curr_interval = [8,10]</p><pre>curr_interval[0] = 8 &gt; ans[ans.length-1][1] = 6</pre><p>沒有重疊，直接 push curr_interval：ans = [[1,6], [8,10]]</p><p>第四輪：curr_interval = [15,18]</p><pre>curr_interval[0] = 15 &gt; ans[ans.length-1][1] = 10</pre><p>沒有重疊，直接 push curr_interval：ans = [[1,6], [8,10], [15, 18]]</p><p>沒了</p><p>返回 ans = [[1,6], [8,10], [15, 18]]</p><h4>複雜度</h4><ul><li>Time Complexity: O(n log n), 因為有做排序</li><li>Space Complexity: O(n), 因為排序可能用 O(n log n) 或 O(n)</li></ul><h4>Python</h4><pre>class Solution:<br>    def merge(self, intervals: List[List[int]]) -&gt; List[List[int]]:<br>        ans = []<br>        for interval in sorted(intervals, key=lambda x: x[0]):<br>            if not ans or interval[0] &gt; ans[-1][1]:<br>                ans.append(interval)<br>            else:<br>                ans[-1][1] = max(ans[-1][1], interval[1])<br>        return ans</pre><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef06525b3f6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-56-merge-intervals-medium-ef06525b3f6a">LeetCode 刷題紀錄 ｜56. Merge Intervals (Medium)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜167. Two Sum II — Input array is sorted (Easy)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-167-two-sum-ii-input-array-is-sorted-easy-b9b23929ea9c?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9b23929ea9c</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Sun, 20 Dec 2020 10:51:29 GMT</pubDate>
            <atom:updated>2020-12-20T10:51:29.014Z</atom:updated>
            <content:encoded><![CDATA[<h3>LeetCode 刷題紀錄 ｜167. Two Sum II — Input array is sorted (Easy)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvAymPJxPxz2FSZbZfoQ9w.png" /></figure><p>這題是 Two Sum 的變形題，他假設輸入的數列會是已經排列好的</p><h3>Two Sum II — Input array is sorted</h3><h4>Question</h4><p>Link: <a href="https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/">https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/</a></p><p>Given an array of integers that is already <strong><em>sorted in ascending order</em></strong>, find two numbers such that they add up to a specific target number.</p><p>The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2.</p><p><strong>Note:</strong></p><ul><li>Your returned answers (both index1 and index2) are not zero-based.</li><li>You may assume that each input would have <em>exactly</em> one solution and you may not use the <em>same</em> element twice.</li></ul><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> numbers = [2,7,11,15], target = 9<br><strong>Output:</strong> [1,2]<br><strong>Explanation:</strong> The sum of 2 and 7 is 9. Therefore index1 = 1, index2 = 2.</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> numbers = [2,3,4], target = 6<br><strong>Output:</strong> [1,3]</pre><p><strong>Example 3:</strong></p><pre><strong>Input:</strong> numbers = [-1,0], target = -1<br><strong>Output:</strong> [1,2]</pre><p><strong>Constraints:</strong></p><ul><li>2 &lt;= nums.length &lt;= 3 * 104</li><li>-1000 &lt;= nums[i] &lt;= 1000</li><li>nums is sorted in <strong>increasing order</strong>.</li><li>-1000 &lt;= target &lt;= 1000</li></ul><h3>Answers</h3><p>這題要學怎麼善用數列已由小到大排列的特性</p><h4>Solution 1: Two Pointers</h4><h4>想法</h4><ol><li>我們可以用兩個指針分別指向第一個元素(指針low)跟最後一個數字(指針high)</li><li>比較兩個數字：</li><li>當兩個數字的和相等於目標數時，我們就找到了題目的唯一解</li><li>如果數字和小於目標，把指著第一個數字的指針 low 往後走，使數字和變大</li><li>如果數字和大於目標，把指著最後一個數字的指針 high 往前走，使數字和變小</li><li>一直重複到找到解為止</li></ol><h4>用範例實際走一遍</h4><p>假設 input array: nums = [1, 2, 3, 4, 7], 目標 target = 6</p><p>起始 low = 0, high = nums.length — 1</p><p>當 low &lt; high 時，sum = nums[low] + nums[high]</p><p>low = 0 &lt; high = 4, sum = 1 + 7 = 8 , 8 &gt; 6，所以把high的指針往前移動, high -=1</p><p>low = 0 &lt; high = 3, sum = 1 + 4 = 5, 5 &lt; 6，所以把low往後移動, low += 1</p><p>low = 1 &lt; high = 3, sum = 2 + 4 =6, 6 = 6, 找到唯一解, 此時 return [low+1, high + 1] 因為要回傳第幾個數字</p><p>ans = [2, 4]</p><h4>Javascript 程式碼如下</h4><pre><br>var twoSum = function(nums, target) {<br>    let low = 0;<br>    let high = nums.length - 1;<br> <br>    while (low &lt; high) {<br>        let sum = nums[low] + nums[high];<br>        if (sum === target) {<br>            return [low + 1, high + 1];<br>        } else if (sum &lt; target) {<br>            low++;<br>        } else {<br>            high--;<br>        }<br>    }<br>    <br>    return [-1, -1];<br>};</pre><h4>複雜度</h4><ul><li>Time complexity: O(n), n個元素最多只會被造訪1次</li><li>Space complexity: O(1), 只用到兩個指針</li></ul><p>Python 程式碼</p><pre>class Solution:<br>    def twoSum(self, numbers: List[int], target: int) -&gt; List[int]:<br>        start = 0<br>        end = len(numbers) - 1<br>        res = []<br>        while start &lt; end:<br>            sum = numbers[start] + numbers[end]<br>            if target &gt; sum:<br>                start+=1<br>            elif target &lt; sum:<br>                end-=1<br>            else:<br>                return [start + 1, end + 1]</pre><p>Reference:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiwkVVs6MuRo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiwkVVs6MuRo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiwkVVs6MuRo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb0adbc6a54f8a641353f52385fee13b/href">https://medium.com/media/cb0adbc6a54f8a641353f52385fee13b/href</a></iframe><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9b23929ea9c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-167-two-sum-ii-input-array-is-sorted-easy-b9b23929ea9c">LeetCode 刷題紀錄 ｜167. Two Sum II — Input array is sorted (Easy)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜238. Product of Array Except Self (Medium)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-238-product-of-array-except-self-medium-a0c81ae3efc5?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0c81ae3efc5</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Sun, 15 Nov 2020 03:03:44 GMT</pubDate>
            <atom:updated>2021-02-24T07:37:15.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ILyE5qR33RVSazGF_a-JyQ.png" /></figure><h3>Product of Array Except Self</h3><h4>Question</h4><p>Given an array nums of <em>n</em> integers where <em>n</em> &gt; 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].</p><p><strong>Example:</strong></p><pre><strong>Input:</strong>  [1,2,3,4]<br><strong>Output:</strong> [24,12,8,6]</pre><p><strong>Constraint:</strong> It’s guaranteed that the product of the elements of any prefix or suffix of the array (including the whole array) fits in a 32 bit integer.</p><p><strong>Note: </strong>Please solve it <strong>without division</strong> and in O(<em>n</em>).</p><p><strong>Follow up:</strong><br>Could you solve it with constant space complexity? (The output array <strong>does not</strong> count as extra space for the purpose of space complexity analysis.)</p><p>這題要算除了自己以外的其他數乘積，且不能用除的作法</p><h3>Solutions</h3><h4>Solution 1: 暴力解 (TLE)</h4><p>Complexity:</p><ul><li>Time: O(n²)</li><li>Space: O(1)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91b322115097e8586c811bbed5254138/href">https://medium.com/media/91b322115097e8586c811bbed5254138/href</a></iframe><h4>Solution 2: Left and Right Product Lists</h4><p>第一種解法的思路是我們記得自己的左邊（除了自己以外）的乘積，跟自己右邊的成績，答案就會是自己的左邊鄰居們 * 右邊鄰居們 = 全部鄰居們</p><p>我們來試試看實作上會長怎樣：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkfQVlK6S_CG1QP0ExTikg.png" /></figure><p>先來看左邊鄰居乘積怎麼做：</p><p>第一個數 4 的左邊沒有東西，所以設為 1</p><p>第二個數 5 的左邊是 4，所以左邊鄰居們乘積為 4</p><p>第三個數 1 的左邊是 5，所以左邊鄰居們的乘積為 4 * 5 = 20</p><p>第四個數 8 的左邊是 1，所以左邊鄰居們的乘積為 20 * 1 = 20</p><p>第五個數 2 的左邊是 8，所以左邊鄰居們的乘積為 20 * 8 = 160</p><p>寫成程式碼的感覺長這樣：</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba36bc5951207cee3c17803280829eca/href">https://medium.com/media/ba36bc5951207cee3c17803280829eca/href</a></iframe><p>再來看右邊鄰居乘積怎麼做：</p><p>nums = [4, 5, 1, 8, 2]</p><p>這次要從最右邊開始，最右邊的數初始為 1 ➡️ [0, 0, 0, 0, 1]</p><p>倒數第二個數8的右邊鄰居是2，1 * 2 = 2 ➡️ [0, 0, 0, 2, 1]</p><p>再來1的右邊鄰居們有8跟2，8 * 2 = 16 ➡️ [0, 0, 16, 2, 1]</p><p>5的右邊鄰居們有1, 8跟2，1 * 16 = 16 ➡️ [0, 16, 16, 2, 1]</p><p>最後，4的右邊鄰居們就要再乘上5，16 * 5 = 80 ➡️ [80, 16, 16, 2, 1]</p><p>寫成程式碼：</p><pre>const rightProductSoFar = Array(len).fill(0) <br>// nums.length - 1 是最後一個數<br>rightProductSoFar[nums.length - 1] = 1 </pre><pre>// nums.length - 2 是倒數第二個數開始，一直更新到 i = 0，i 逐漸遞減<br>for (let i = nums.length - 2; i &gt;= 0; i--) {                <br>    rightProductSoFar[i] = nums[i+1] * rightProductSoFar[i+1]     <br>}</pre><p>有了除自己以外兩邊鄰居乘積的數列後，就可以來算最後的總鄰居和</p><p>output[i] = L[i] * R[i]</p><p>結合在一起，最後程式碼長這樣：</p><pre>/**<br> * <a href="http://twitter.com/param">@param</a> {number[]} nums<br> * <a href="http://twitter.com/return">@return</a> {number[]}<br> */</pre><pre>var productExceptSelf = function(nums) {<br>    const len = nums.length;<br>    const L = Array(len).fill(0)<br>    const R = Array(len).fill(0)    <br>    const output = Array(len).fill(0)<br>    <br>    L[0] = 1<br>    for (let i = 1; i &lt; len; i++) {<br>        L[i] = nums[i-1] * L[i-1]<br>    }<br>    <br>    R[len-1] = 1<br>    for (let i = len-2; i &gt;= 0; i--) {<br>        R[i] = nums[i+1] * R[i+1]<br>    }<br>    <br>    for (let i = 0; i &lt; len; i++) {<br>        output[i] = L[i] * R[i]<br>    }<br>    <br>    return output;<br>};</pre><p>Python:</p><pre>class Solution:<br>    def productExceptSelf(self, nums: List[int]) -&gt; List[int]:<br>        length = len(nums)<br>        <br>        L, R, answer = [0]*length, [0]*length, [0]*length<br>        <br>        L[0] = 1<br>        for i in range(1, length):<br>            L[i] = nums[i - 1] * L[i - 1]<br>        <br>        R[length - 1] = 1<br>        for i in reversed(range(length - 1)):<br>            R[i] = nums[i + 1] * R[i + 1]<br>        <br>        for i in range(length):<br>            answer[i] = L[i] * R[i]<br>        <br>        return answer</pre><p>Complexity:</p><ul><li>Time: O(n)</li><li>Space complexity : O(N) used up by the two intermediate arrays that we constructed to keep track of product of elements to the left and right.</li></ul><h4>Solution 3: O(1) 優化空間複雜度</h4><p>題目說 answer array 不會增加空間複雜度，所以優化的作法試試看只用 answer array來先存左邊鄰居乘積和，再存乘上右邊鄰居和，就可以省下兩個array，讓空間複雜度降低為O(1)</p><pre>var productExceptSelf = function(nums) {<br>    const len = nums.length;<br>    const output = Array(len).fill(0)<br>    <br>    output[0] = 1<br>    for (let i = 1; i &lt; len; i++) {<br>        output[i] = nums[i-1] * output[i-1]<br>    }<br>    <br>    let R = 1<br>    for (let i = len-1; i &gt;= 0; i--) {<br>        output[i] = output[i] * R<br>        R *= nums[i]<br>    }<br>    <br>    return output;<br>};</pre><p><strong>Complexity analysis</strong></p><ul><li>Time complexity : <em>O</em>(<em>N</em>)</li><li>Space complexity : <em>O</em>(1)</li></ul><p>其他可以參考的影片：</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8GYQ4sELAjc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8GYQ4sELAjc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8GYQ4sELAjc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/17c7ed3a01c06a935e1a5b6dccf6ac02/href">https://medium.com/media/17c7ed3a01c06a935e1a5b6dccf6ac02/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtSRFtR3pv74%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtSRFtR3pv74&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtSRFtR3pv74%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b82ea2ee5463f72ce298124efb0dae4/href">https://medium.com/media/8b82ea2ee5463f72ce298124efb0dae4/href</a></iframe><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0c81ae3efc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-238-product-of-array-except-self-medium-a0c81ae3efc5">LeetCode 刷題紀錄 ｜238. Product of Array Except Self (Medium)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜242. Valid Anagram (Easy)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-242-valid-anagram-easy-1371a24af1c9?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/1371a24af1c9</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Sat, 14 Nov 2020 06:36:03 GMT</pubDate>
            <atom:updated>2020-11-14T06:36:03.181Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDo5ct0x_F6k26NCw-_2YA.png" /></figure><h3>242. Valid Anagram</h3><p>Link: <a href="https://leetcode.com/problems/valid-anagram/solution/">https://leetcode.com/problems/valid-anagram/solution/</a></p><h4>Question</h4><p>Given two strings <em>s</em> and <em>t </em>, write a function to determine if <em>t</em> is an anagram of <em>s</em>.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> <em>s</em> = &quot;anagram&quot;, <em>t</em> = &quot;nagaram&quot;<br><strong>Output:</strong> true</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> <em>s</em> = &quot;rat&quot;, <em>t</em> = &quot;car&quot;<br><strong>Output: </strong>false</pre><p><strong>Note:</strong><br>You may assume the string contains only lowercase alphabets.</p><p>先查一下<strong>Anagram</strong>的定義是什麼：</p><p>‘a word or phrase made by using the letters of another word or phrase in a different order: <em>“Neat” is an anagram </em><strong><em>of</em></strong><em> “a </em><a href="https://dictionary.cambridge.org/zht/%E8%A9%9E%E5%85%B8/%E8%8B%B1%E8%AA%9E/net"><em>net</em></a><em>”.’</em></p><p>就example來看的話，符合anagram兩組字，代表組成這兩個單字的字母元素與個數會是一樣的：</p><p>anagram 是 3 個 a, 1 個 n, 1 個 g, 1 個r, 1 個 m<br>nagaram 也是 a * 3, n * 1, g * 1, r * 1, m * 1</p><p>這兩個字就是 anagram, 預期的產出是 true</p><p>a , b -&gt; 不是<br>aaavv, avvaa -&gt; 是<br>rot, rat -&gt; 不是<br>ret, etr -&gt; 是</p><h3>Answers</h3><ul><li>Sorting</li><li>Hash Table</li></ul><p>這題有兩種可能的作法，一種是用排序把字串按a-z順序排好之後，比對兩個字串是否相等；另一種做法是用Hash Table去存每個字母的個數，以此比對個數是否相同。</p><h4>Solution 1: Sorting</h4><p>Sorting 的作法很簡單，就是把兩個字串都排整齊了，就可以把兩個字串比對</p><p>Example: “<br>把 ‘anna’, ‘nana’ 排序成 =&gt; aann, aann</p><p>Sorting 需要將 String 先 split 成 Array</p><pre>string = &#39;hello&#39;<br>array = string.split(&#39;&#39;)<br>console.log(array)<br>// [&#39;h&#39;,&#39;e&#39;,&#39;l&#39;,&#39;l&#39;,&#39;o&#39;]</pre><p>因為我用的是 Javascript，沒辦法用 array1 === array2 的方式來判別兩 array 是否相等（因為兩個 array variables 是指向不同 references）</p><p>但是，可以判別兩字串是否相等，所以先將字串轉成array去排序，排序完再轉回字串比較是否相等</p><p>Example:</p><pre>[1,2,3] === [1,2,3]         // return false<br>[1,2,3].toString() == [1,2,3].toString()      // true<br>[1,2,3].join(&#39;,&#39;) == [1,2,3].join(&#39;,&#39;)        // true</pre><p>Code:</p><pre>var isAnagram = function(s, t) {<br>    if (s.length !== t.length) return false;<br>    <br>    s = s.split(&#39;&#39;).sort().join(&#39;&#39;);<br>    t = t.split(&#39;&#39;).sort().join(&#39;&#39;);<br>    <br>    return s == t // 也可以寫成 one-liner<br>};</pre><pre>// 用 [...]</pre><pre>var isAnagram = function(s, t) {<br>    if (s.length !== t.length) return false;<br>    <br>    const arrays = [...s].sort();<br>    const arrayt = [...t].sort();<br>    <br>    for (let i = 0; i &lt; s.length; i++) {<br>        if (arrays[i] !== arrayt[i]) {<br>            return false<br>        }<br>    }<br>    <br>    return true<br>};</pre><p>Complexity:</p><ul><li>Time: O(nlogn)</li><li>Space: O(1)</li></ul><h4>Solution 2: Hash Table</h4><p>Complexity:</p><ul><li>Time: O(n)</li><li>Space: O(1)</li></ul><p>Hash Table 這裡有幾種作法，主要是幾種 loop 的作法不太一樣</p><ol><li>第一個 loop一個加一個減個數，第二個 loop 檢查是否每個字母總和都是零</li><li>第一個 loop 專門增加，第二個 loop 專門減少，減少的過程若小於零 return false</li></ol><p><strong>Hash Table 1</strong></p><p>數兩個字串的各字母個數是否相等，用 counter 或 hash table 來存 {字母: 數量}</p><p>比較省時的方式：不需要存兩個 hash map, 在一個loop之中，一個加一個減，若相等，總和最後應該都要是零</p><p>最後再用一個loop檢查0</p><pre>var isAnagram3 = function (s, t) {<br>  if (s.length !== t.length) return false;</pre><pre>  const sMap = {};</pre><pre>  for (let i = 0; i &lt; s.length; i++) {<br>    sMap[s[i]] == undefined ? (sMap[s[i]] = 1) : sMap[s[i]]++;<br>    sMap[t[i]] == undefined ? (sMap[t[i]] = -1) : sMap[t[i]]--;<br>  }</pre><pre>  for (key in sMap) {<br>    if (sMap[key] !== 0) return false;<br>  }</pre><pre>  return true;<br>};</pre><p>看到用map來實作覺得很有趣, 試玩看看 map</p><pre>// map<br>var isAnagram4 = function (s, t) {<br>  if (s.length !== t.length) return false;</pre><pre>  const map = {};<br>  s.split(&#39;&#39;).map((char) =&gt; (map[char] = map[char] ? map[char] + 1 : 1));<br>  t.split(&#39;&#39;).map((char) =&gt; (map[char] = map[char] ? map[char] - 1 : -1));</pre><pre>  return Object.keys(map).every((k) =&gt; map[k] === 0);<br>};</pre><p><strong>Hash Table 2</strong></p><p>也可以分開兩個loop, 一個專門增加，一個專門減少，減少的過程若小於零 return false</p><pre>var isAnagram5 = function (s, t) {<br>  if (s.length !== t.length) return false;</pre><pre>  const sMap = {};</pre><pre>  for (let i = 0; i &lt; s.length; i++) {<br>    sMap[s[i]] === undefined ? (sMap[s[i]] = 1) : sMap[s[i]]++;<br>  }</pre><pre>  for (let i = 0; i &lt; s.length; i++) {<br>    sMap[t[i]] === undefined ? (sMap[t[i]] = -1) : sMap[t[i]]--;<br>    if (sMap[t[i]] &lt; 0) return false;<br>  }</pre><pre>  return true;<br>};</pre><p>Python 作法:</p><pre>class Solution:<br>    def isAnagram1(self, s: str, t: str) -&gt; bool:<br>        if len(s) != len(t):<br>            return False<br>    <br>        dict = {}<br>        for c in s:<br>            if c not in dict:<br>                dict[c] = 1<br>            else:<br>                dict[c] += 1<br>        for c in t:<br>            if c not in dict:<br>                return False<br>            else:<br>                dict[c] -= 1<br>                if dict[c] &lt; 0:<br>                    return False<br>        return True</pre><pre># Python 的 One-liner</pre><pre>class Solution:<br>    def isAnagram2(self, s: str, t: str) -&gt; bool:<br>        return sorted(s) == sorted(t)</pre><pre># 在討論區看到的有趣作法，速度超快 faster than 97.43% of Python3 submissions</pre><pre>class Solution:<br>    def isAnagram3(self, s: str, t: str) -&gt; bool:<br>        return all(s.count(x) == t.count(x) for x in &#39;abcdefghijklmnopqrstuvwxzy&#39;)</pre><p>這題不算難，但好玩的是可以用很多不同的角度去切入，多看看不同的作法</p><p>Javascript 還好有多新的函數都還沒試過，希望之後可以多試試~</p><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1371a24af1c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-242-valid-anagram-easy-1371a24af1c9">LeetCode 刷題紀錄 ｜242. Valid Anagram (Easy)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜121. Best Time to Buy and Sell Stock (Easy)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-121-best-time-to-buy-and-sell-stock-easy-afa7f69780c7?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/afa7f69780c7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Fri, 13 Nov 2020 00:35:26 GMT</pubDate>
            <atom:updated>2020-11-13T00:35:26.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Klt2xmnDTFbVMcrQAoH9HA.png" /></figure><p>看到這題名字可能會想到 Dynamic Programming，但這題是 Stock 系列的忙內（？），解法不複雜～</p><h3>121. Best Time to Buy and Sell Stock</h3><p>Link: <a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock/">https://leetcode.com/problems/best-time-to-buy-and-sell-stock/</a></p><h4>Question</h4><p>Say you have an array for which the <em>i</em>th element is the price of a given stock on day <em>i</em>.</p><p>If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.</p><p>Note that you cannot sell a stock before you buy one.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> [7,1,5,3,6,4]<br><strong>Output:</strong> 5<br><strong>Explanation:</strong> <br>Buy on day 2 (price = 1) and sell on day 5 (price = 6), <br>profit = 6-1 = 5. Not 7-1 = 6, as selling price needs to be larger than buying price.</pre><p><strong>Example 2:</strong></p><pre><strong>Input:</strong> [7,6,4,3,1]<br><strong>Output:</strong> 0<br><strong>Explanation:</strong> <br>In this case, no transaction is done, i.e. max profit = 0.</pre><p>題目給的 Array 裡面每一個數字都代表當天的股價，請你算出哪天買入哪天賣出會得到最大收益，輸出只需要給收益的數字。要注意要先買進才能賣出，所以 Array 不能亂動～如果會賠錢就都不要買賣</p><h3>Answers</h3><p>Solutions:</p><ul><li>Naive: 2 loops</li><li>One pass with tracking the min price</li></ul><h4>1: Brute Force</h4><p>暴力解就是去抓每一個買入買出的收益，去看哪個最大</p><p>[7,1,5,3,6,4]</p><p>i = 0, 買入prices[i]: 7, 賣出 prices[j]: 1 (-6), 5(-2), 3(4), 6(-1), 4(-3), <br>最大收益=4</p><p>i = 1, 買入prices[i]: 1, 賣出 prices[j]: 5(4), 3(2), 6(5) 最大收益為 <strong>5</strong>, 4(3), <br>最大收益仍為 <strong>5</strong></p><p>i = 2,買入prices[i]: 5, 賣出 prices[j]: 3(-2), 6(1), 4(-1) 最大收益仍為 <strong>5</strong></p><p>i = 3, 買入prices[i]: 3, 賣出 prices[j]: 6(-3), 4(1), 最大收益仍為 <strong>5</strong></p><p>i = 4, 最後買入prices[i]: 6, 賣出 prices[j]: 4(-2), 最大收益仍為 <strong>5</strong></p><ul><li>Time complexity: O(n²)</li><li>Space complexity: O(1)</li></ul><pre>var maxProfit = function (prices) {<br>  let maxProfit = 0;</pre><pre>  for (let i = 0; i &lt; prices.length - 1; i++) {<br>    for (let j = i + 1; j &lt; prices.length; j++) {<br>      if (prices[j] - prices[i] &gt; maxProfit) {<br>        maxProfit = prices[j] - prices[i];<br>      }<br>    }<br>  }</pre><pre>return maxProfit;<br>};</pre><h4>2: One Pass</h4><p>投過記住歷史最低買入價的方式，減少成只需要一個loop就好</p><p>[7,1,5,3,6,4]</p><p>i = 0, prices[i] = 7, minPrice = 7, prices[i] — minPrice = 0, maxProfit = 0</p><p>i = 1, prices[i] = 1, minPrice = 1, prices[i] — minPrice = 0, maxProfit = 0</p><p>i = 2, prices[i] = 5, minPrice = 1, prices[i] — minPrice = 4, maxProfit = 4</p><p>i = 3, prices[i] = 3, minPrice = 1, prices[i] — minPrice = 2, maxProfit = 4</p><p>i = 4, prices[i] = 6, minPrice = 1, prices[i] — minPrice = 5, maxProfit = 5</p><p>i = 5, prices[i] = 4, minPrice = 1, prices[i] — minPrice = 3, maxProfit = 5</p><p>答案：5</p><ul><li>Time complexity: O(n)</li><li>Space complexity: O(1)</li></ul><p><strong>Javascript:</strong></p><pre>var maxProfit = function (prices) {<br>  let maxProfit = 0;<br>  let minPrice = Infinity;</pre><pre>  for (let i = 0; i &lt; prices.length; i++) {<br>    minPrice = Math.min(minPrice, prices[i])<br>    maxProfit = Math.max(maxProfit, (prices[i] - minPrice))<br>  }</pre><pre>  return maxProfit;<br>};</pre><p><strong>Python</strong>:</p><pre>class Solution:<br>    def maxProfit(self, prices: List[int]) -&gt; int:<br>        minprice = float(&#39;inf&#39;)<br>        maxprofit = 0<br>        <br>        for num in prices:<br>            minprice = min(minprice, num)<br>            maxprofit = max(maxprofit, num - minprice)<br>                <br>        return maxprofit</pre><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afa7f69780c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-121-best-time-to-buy-and-sell-stock-easy-afa7f69780c7">LeetCode 刷題紀錄 ｜121. Best Time to Buy and Sell Stock (Easy)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode 刷題紀錄 ｜217. Contains Duplicate (Easy)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-217-contains-duplicate-easy-647bc2ccdcf6?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/647bc2ccdcf6</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Thu, 12 Nov 2020 23:31:12 GMT</pubDate>
            <atom:updated>2020-11-12T23:34:16.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhtqRodv8J-FiOpKugxgiA.png" /></figure><p>第一週 Sequences 系列的第二題 Contains Duplicate，這題也不難，適合新手熟悉一些基本概念。</p><h3>Contains Duplicate</h3><h4>Questions</h4><p>Given an array of integers, find if the array contains any duplicates.</p><p>Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.</p><p><strong>Example 1:</strong></p><pre><strong>Input:</strong> [1,2,3,1]<br><strong>Output:</strong> true</pre><p><strong>Example 2:</strong></p><pre><strong>Input: </strong>[1,2,3,4]<br><strong>Output:</strong> false</pre><p><strong>Example 3:</strong></p><pre><strong>Input: </strong>[1,1,1,3,3,4,3,2,4,2]<br><strong>Output:</strong> true</pre><p>簡單來說，只要 Array 中有重複出現的數字就回傳 true，如果都沒有重複就回傳 false。</p><h3>Answers</h3><ul><li>Brute force (Time Limit Exceeded)</li><li>Sorting</li><li>Hash Table</li></ul><h4>1. Brute Force — Naive Linear Search</h4><ul><li>Time complexity: O(n²)</li><li>Space complexity: O(1)</li></ul><p>第一個最暴力解就是用兩個 loops 下去一一比對，如果抓到有一樣的就 return true，如果都沒有抓到就在最後 return false。此解法會超時無法通過</p><pre>public boolean containsDuplicate(int[] nums) {<br>    for (int i = 0; i &lt; nums.length; ++i) {<br>        for (int j = 0; j &lt; i; ++j) {<br>            if (nums[j] == nums[i]) return true;  <br>        }<br>    }<br>    return false;<br>}<br>// Time Limit Exceeded</pre><h4>2. Sorting</h4><ul><li>Time complexity: O(<em>n</em>log<em>n</em>)</li><li>Space complexity: O(1) (depends on what sorting algorithm it uses)</li></ul><p>稍微優化，先將 array 中的數字按大小排序，這樣只需要用一個loop比較自己跟自己身邊的數字就可以，不需要比較鄰居以外的地方。</p><p>時間複雜度降低到 <em>O</em>(<em>n</em>log<em>n</em>)：Sorting 是 <em>O</em>(<em>n</em>log<em>n</em>)，loop 是 <em>O</em>(<em>n</em>)，相加取其大者為 <em>O</em>(<em>n</em>log<em>n</em>)</p><p>這個做法比較需要留意的是 sorting 的方法，可以複習一下各種 sorting 的時間複雜度與空間複雜度。在 LeetCode 給的解答是假設使用 Heapsort。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*clCH3B-N-rp7RfvlMY9o7g.png" /><figcaption>src: <a href="https://www.bigocheatsheet.com/">https://www.bigocheatsheet.com/</a></figcaption></figure><pre>var containsDuplicate = function(nums) {<br>    nums.sort((a,b) =&gt; a-b)<br>    for (let i = 0; i &lt; nums.length -1; i++){<br>        if (nums[i] === nums[i+1]) return true<br>    }<br>    return false<br>};</pre><h4>3. Hash Table</h4><p>用 Hash Table 因為 lookup O(1), loop 第一次 O(n)，跟 Two Sum 一樣都是空間換取時間的作法。</p><ul><li>Time complexity: O(<em>n</em>)</li><li>Space complexity: O(<em>n</em>) (Hash Table 佔掉的空間會隨 nums 大小上升)</li></ul><pre>var containsDuplicate = function(nums) {<br>    let map = {}<br>    for (let i = 0; i &lt; nums.length; i++){<br>        if (map[nums[i]]) {<br>            return true<br>        } else {<br>            map[nums[i]] = i;<br>        }<br>    }<br>    return false<br>};</pre><p>新手上路，如果有寫錯的地方歡迎大力糾正，歡迎留言討論或是到我的Socials找我~謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website — <a href="http://roywannago.com/">roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=647bc2ccdcf6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-217-contains-duplicate-easy-647bc2ccdcf6">LeetCode 刷題紀錄 ｜217. Contains Duplicate (Easy)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leetcode 刷題紀錄 ｜1. Two Sum]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-1-two-sum-ebdbff4d715c?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebdbff4d715c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Thu, 12 Nov 2020 23:07:41 GMT</pubDate>
            <atom:updated>2020-11-12T23:07:41.224Z</atom:updated>
            <content:encoded><![CDATA[<h3>LeetCode 刷題紀錄 ｜1. Two Sum (Easy)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNkaDCMMsZ7OxtARS1I3fg.png" /></figure><p>第一題是經典 Two Sum</p><h3>Two Sum</h3><h4>Question:</h4><p>Given an array of integers nums and an integer target, return <em>indices of the two numbers such that they add up to </em><em>target</em>.</p><p>You may assume that each input would have <strong><em>exactly</em> one solution</strong>, and you may not use the <em>same</em> element twice.</p><p>You can return the answer in any order.</p><p><strong>Example 1:</strong></p><pre>Input: nums = [2,7,11,15], target = 9<br>Output: [0,1]<br>Output: Because nums[0] + nums[1] == 9, we return [0, 1].</pre><p><strong>Example 2:</strong></p><pre>Input: nums = [3,2,4], target = 6<br>Output: [1,2]</pre><p><strong>Example 3:</strong></p><pre>Input: nums = [3,3], target = 6<br>Output: [0,1]</pre><p><strong>Constraints:</strong></p><ul><li>2 &lt;= nums.length &lt;= 105</li><li>109 &lt;= nums[i] &lt;= 109</li><li>109 &lt;= target &lt;= 109</li><li><strong>Only one valid answer exists.</strong></li></ul><h3>Answers</h3><ul><li>Brute Force</li><li>Hash Table — Two-Pass</li><li>Hash Table — One-Pass</li></ul><h4>1. Brute Force 最暴力解</h4><p>Go through two loops to compare one and another to see if the two numbers meet the target</p><p>就是一個個抓起來比看配不配</p><ul><li>Time complexity: O(n²)</li><li>Space complexity: O(1)</li></ul><pre>var twoSum = function(nums, target) {<br>    for (let i = 0; i &lt; nums.length - 1; i++) {<br>        for (let j = i+1; j &lt; nums.length; j++) {<br>            if (nums[i]+nums[j] === target) {<br>                let result = [i, j]<br>                return result<br>            }<br>        }<br>    }<br>};</pre><h4>2. Hash Table Two-Pass</h4><ol><li>Try to lower the time complexity with space complexity</li><li>We want to check if the element exists</li><li>We want to track the index of the element</li><li>Lookup in the hash table takes linear time if there is no collision</li></ol><p>以空間換取時間，因為Hash Table的look up只需O(1)，很適合用在這題。從原本的兩層 loop: O(n * n) 進步成兩個 loop: O(n+n) = O(n)。</p><p>Hash Table 的架構會長這樣 value: ‘index’：</p><p>Input: [7, 2, 11, 20]<br>Hash Table: {7: ‘0’, 2: ’1&#39;, 11: ‘2’, 20: ‘3’}</p><ul><li>Time complexity: O(n)</li><li>Space complexity: O(n)</li></ul><pre>var twoSum = function(nums, target) {<br>  let map = {};</pre><pre>  <em>// First loop: add value &amp; index into hash table</em></pre><pre>  for (let i = 0; i &lt; nums.length; i++) {<br>    map[nums[i]] = i;<br>  }</pre><pre><em>  // Second loop: </em><br>  <em>// check if their complement(= target-value) in the hash table and  </em><br>  <em>// complement cannot be itself so we check with the index</em></pre><pre>  for (let i = 0; i &lt; nums.length; i++) {<br>    let complement = target - nums[i];</pre><pre>    <em>// if found and it is not itself, return</em><br>    if (map[complement] != null &amp;&amp; map[complement] != i) {<br>      return [i, map[complement]];<br>    }<br>  }<br>}</pre><h4>3. Hash Table — One-Pass</h4><ol><li>We check if the complement exists in the first loop when creating the bucket</li><li>We can use in to check if the specified property is in the specified object or its prototype chain (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in">Reference</a>)</li></ol><p>在 loop 時就直接先找目前為止建立起來的 hash table 裡面有沒有該數的complement，可以加速查找的速度，一次 loop 就可以結束了。 回傳該數的index 跟存在裡面的 index。注意建立 hash table 的動作是放在 if statement 之外的，不論有沒有找到都要建立起 hash table。</p><h4>Javascript:</h4><pre>var twoSum = function (nums, target) {<br>  let map = {};</pre><pre>  for (let i = 0; i &lt; nums.length; i++) {<br>    const complement = target - nums[i];</pre><pre>    // Chech if complement already in the table<br>    if (complement in map) {<br>      // if found, return<br>      return [map[complement], i];<br>    }<br>    <br>    // add value &amp; index into hash table<br>    map[nums[i]] = i;<br>   }</pre><pre>  return null;<br>};</pre><h4>Python:</h4><pre>class Solution:<br>    def twoSum(self, nums: List[int], target: int) -&gt; List[int]:<br>        hashtable = {}<br>        <br>        for i in range(len(nums)):<br>            complement = target - nums[i]<br>            if complement in hashtable:<br>                return [hashtable[complement], i]<br>            hashtable[nums[i]] = i<br>        return</pre><ul><li>Time: O(n)</li><li>Space: O(n)</li></ul><p>歡迎留言討論或是到我的Socials找我~新手上路，如果有寫錯的地方歡迎大力糾正，謝謝觀看！</p><h3>About Roy</h3><p><strong>Social Media</strong><br>Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br>Twitter — <a href="http://twitter.com/roywannago">@roywannago</a><br>Instagram — <a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br>Website —<a href="http://roywannago.com/"> roywannago.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebdbff4d715c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/leetcode-%E5%88%B7%E9%A1%8C%E7%B4%80%E9%8C%84-1-two-sum-ebdbff4d715c">Leetcode 刷題紀錄 ｜1. Two Sum</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[學會如何自學是邁入成功的第一步]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E5%AD%B8%E6%9C%83%E5%A6%82%E4%BD%95%E8%87%AA%E5%AD%B8%E6%98%AF%E9%82%81%E5%85%A5%E6%88%90%E5%8A%9F%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5-b3326ba1e5f8?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3326ba1e5f8</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[grit]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[self]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 02:31:45 GMT</pubDate>
            <atom:updated>2020-09-11T02:31:45.669Z</atom:updated>
            <content:encoded><![CDATA[<p>｜你的恆毅力有多高，你就多有機會成功<br>｜自學資源推薦</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VEgojTc8h4JzgsGm" /><figcaption>Photo by <a href="https://unsplash.com/@morningbrew?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Morning Brew</a> on <a href="https://unsplash.com/@morningbrew?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>學會如何自學是邁入成功的第一步</h3><p>嗨，我是 Roy!</p><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E7%BE%8E%E5%9C%8B-%E5%BE%9E%E9%9B%B6%E5%88%B0%E7%AC%AC%E4%B8%80%E4%BB%BD%E5%AF%A6%E7%BF%92-ux-%E5%AF%A6%E7%BF%92%E8%BD%89%E9%A0%98%E5%9F%9F%E6%B1%82%E8%81%B7%E5%88%86%E4%BA%AB-2019-%E4%B8%8A-d1eae1462c43?source=your_stories_page---------------------------">上一篇</a>介紹了一下為什麼我想要轉碼，可以看得出來，我學寫程式的旅程是斷斷續續的。也許可能歸功於我個人做事的三分鐘熱度，所以在投入一件事的時候，我總是容易馬上採取行動一頭栽進，過了一陣子覺得好像有更好玩的事情，才又離開去做別的事。</p><p>這樣的個性有好也有不好，有些朋友說我行動力很強（想去交換就準備申請，想去澳洲就做好功課買機票，想申請美國研究所就在半年內考完試申請），但你也可以說，我是樣樣通樣樣鬆。</p><p>這一年看了許多自我成長跟認知心理學相關的書籍，包括刻意練習、原子習慣、心流、The power of habit、Peak等。其實看到最後會發現，很多學者都在用不同的語言講很類似的事情。今天先暫且不談這些書的內容，想稍微介紹最近在看的 <strong>恆毅力 Grit</strong> 。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/0*0CqondP9AIyFgVPJ" /><figcaption>恆毅力 Grit</figcaption></figure><h3>你的恆毅力有多高，你就多有機會成功</h3><p>恆毅力這本書一樣是想要探討，為什麼成功人士之所以能成功？作者發現， <strong>秘訣不在於要多聰明、多熱情，而是你能不能把一件事不間斷、不放棄的做到最好</strong> 。「三分鐘熱度很常見，持久的熱情則很罕見」。</p><p>這件事聽起來很簡單，但又能引出一大堆背後的疑問：</p><p>我要怎麼知道我想要做的是哪一件事？</p><p>我要怎麼確保我做的事情是，12年下來每年都能成長進步，還是只是做同一件事做了12年？</p><p>再延伸，又能討論你要怎麼確保提供自己足夠的興趣，以及恰到好處的挑戰，讓你在做的這件事充滿趣味又能永續發展？</p><p>我在看這本書的時候，有時認可，有時充滿疑問與抵抗。如果照作者說一生做一件事的人才是有恆毅力，那像我這樣先念商，再轉設計，又想轉程式的人，不就完全的逃避廢物？</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VTKlr6t_MjRMKsu1" /><figcaption><em>Photo by Estée Janssens on Unsplash</em></figcaption></figure><p>但隨著章節的前進，作者也點到了這方面的疑問。</p><h3>一開始就知道自己想做什麼的人，幾乎不太可能存在。</h3><p>研究證實，小時候嘗試過多種不同項目後，才選定一個項目深入訓練的運動員，長期而言表現更好。沒有嘗試過的運動員，也許有初期的優勢，但他們也比較可能受傷或耗盡熱情。</p><p>作者也提了一個在東非駐點的、得過普立茲獎的記者的故事，他的熱情其實不是新聞，而是待在東非，記者這個職業剛好是讓他留在東非的一種方式。</p><p>這兩個故事讓我用另一個方向切入我的旅程。</p><p>雖然我換了幾次職涯方向，但我一直都知道我最終想要創業，所以 <strong>不管我換到什麼專業，其實都是在培養創業可能會用到的技能與思維</strong> 。從企業管理、行銷、財金、產品設計到程式開發，這些我有興趣的技能，其實都是幫助我建立將來往創業前進的基石。</p><p>又，如我第一天的文章提到的，我的夢想是環遊世界，我不管做出怎麼樣的決定，我都是想著，這樣能不能帶我到更多的國家生活，體驗更多不同的人生與文化。就是這樣的思考，讓我更確定，我在做的事情不只是在逃避，而是用更靈活且不失方向的方式，一步步往我的十年目標前進。</p><p>話說回來自學這件事，這幾本書都提到了， <strong>自己去找資源學習你熱愛的事物，是一個成功人士很重要的特質</strong> 。他們若想做什麼事情，他們會自己想盡方法獲取知識，找認識的朋友、尋求導師指導等。我覺得自學對於程式設計師來說，也是不可或缺的一樣特質。感謝科技的進步，現在想學什麼事情，只要上網搜尋一下 YouTube 教學影片、大學公開課、線上網路課程教學、部落格，只要花些時間多輸入一些關鍵字，你幾乎就能找到相關的資源學習。</p><p>講了這麼多，直接切入我用過且推薦的自學資源吧！</p><h3>正規學校教學 — 隨班附讀</h3><p>你可能會想說，在學校學習算什麼自學？但我想要說，被動的上必修課，只想要低空飛過，跟自己主動接觸學習是兩回事。對於在求學過程中，因為分數剛剛好落在那裡就去念的台灣學生不在少數，台灣能自由轉學、轉系的學校又不是很多。（到底為什麼轉系還要先考到全班前五名？如果我成績那麼好那我為什麼還要轉系？太鬧了）</p><p>如果你是畢業之後，才發現自己對某專業有興趣的話，台灣有些大學有提供社會人士隨班就讀的方式，你只要申請、繳費，你就能跟著大學生一起在課堂上課！</p><p>&gt; <strong><em>隨班附讀學分班</em></strong><em> 是你會想要搜尋的關鍵字。</em></p><p>我自己的經驗是在我的母校 <a href="http://www.cec.ntust.edu.tw/s04-class.html">臺灣科技大學隨班附讀</a>修過資料結構與離散數學。你必須先從 <a href="https://querycourse.ntust.edu.tw/querycourse/">課程查詢系統</a> 裡面找到你想要上的課程，詢問教授是否接受隨班附讀，確定可以之後，繳交報名費、學分費等，就能在開學之後，跟大學生一起上課了。注意，這是跟著大學原本的課程，所以開課的時間有可能是在白天，可能不適合在職人士就讀，請自己找尋你適合的時間跟課程，印象中台北有幾所學校都有開放類似的學分班申請！</p><ul><li>優點：</li></ul><ol><li>適合喜歡面對面上課的人</li><li>會拿到學分跟正式的成績單，之後要申請學校可以使用</li><li>重返校園的感覺蠻好</li></ol><ul><li>缺點：</li></ul><ol><li>時間不彈性，需白天有空</li><li>有點貴，一學分要 3000 台幣</li><li>老師評價不一，比較難事先做功課除非你認識該校學生</li></ol><h3>正規學校教學 — 公開課</h3><p>全世界的大學都在把他們的課程放到網路上，當你有機會上哈佛大學的課，免費！還不試試看？<br>以下提供幾個平台：</p><h4>1. Coursera: <a href="https://www.coursera.org/">https://www.coursera.org/</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*OnAblwKI32Xkn5HE.png" /></figure><p>有課程 Cource、專案 Guided Project、專業學程 Specializations、專業證書 Professional Certificates 跟 Online degrees 等不同的選項。旁聽課程通常不用錢，也可以申請助學金，其他方式有可能是要收費。</p><ul><li>優點：</li></ul><ol><li>有機會一窺歐美名校課程</li><li>Coursera會幫你排好課程進度</li><li>時間較彈性，但收費課程會需要你在時間內完成作業</li><li>修課認證</li></ol><ul><li>缺點：</li></ul><ol><li>有的教授有時候還是講話比較學術、比較無聊XD</li><li>程式課程不一定最貼近業界需求</li><li>有時候不一定有中文字幕</li></ol><h4>2. edX: <a href="https://www.edx.org/">https://www.edx.org/</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hrzbPijcdji72Uj4.png" /></figure><p>edX 是哈佛跟MIT開發的線上課程系統，裡面也有許多名校的課程，知名的 <a href="https://www.edx.org/course/cs50s-introduction-to-computer-science">CS50</a> 就在這個平台。</p><ul><li>Harvard: <a href="https://www.edx.org/school/harvardx">https://www.edx.org/school/harvardx</a></li><li>MIT: <a href="https://www.edx.org/school/mitx">https://www.edx.org/school/mitx</a></li><li>University of Michigan: <a href="https://www.edx.org/school/michiganx">https://www.edx.org/school/michiganx</a></li></ul><h4>3. 各校自己開發的 MOOC/OCW</h4><p>蠻多學校都有自己的線上公開課網站，如 <a href="https://ocw.nctu.edu.tw/index.php">交通大學</a>、 <a href="http://ocw.aca.ntu.edu.tw/ntu-ocw/">台灣大學</a>、 <a href="http://ocw.nsysu.edu.tw/bin/home.php">中山大學</a> 等，我只列出我有用過的，但相信應該有更多等著你去發掘。</p><h3>線上課程</h3><p>接下來進入百家爭鳴的各種線上平台，因為太多了，我就附上我學過或正在學的課程：</p><h4>1. Udacity</h4><p>裡面有很多很適合新手看的基礎課程，特別的是 Udacity 跟業界合作開了一系列的自駕車課程</p><ol><li><strong>CS101 Intro to Computer Science: </strong><br><a href="https://classroom.udacity.com/courses/cs101">https://classroom.udacity.com/courses/cs101</a> <br>我的啟蒙課程</li><li><strong>How to use Git/Github: </strong><br><a href="https://classroom.udacity.com/courses/ud775">https://classroom.udacity.com/courses/ud775</a><br>對於Git有困惑的時候，我修了這堂課還不錯</li></ol><h4>2. Udemy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*4NN7dZUwQk_pmSuT.png" /></figure><p>之前上了半路出家工程師推薦的 Andrei 老師的課之後，一試成主顧，我就也開始修了其他 <a href="https://zerotomastery.io/">Zero to Mastery</a> 的課，真的大力推薦：</p><ol><li><a href="https://www.udemy.com/share/101WcUA0AacFdWRXQ=/"><strong>The Complete Web Developer in 2020</strong></a><strong><br></strong> 這堂課帶你從最簡單的 HTML 開始一路到用 React + Nodejs + SQL 做出你的第一個大 project，其中我最喜歡的是 Zero to mastery 的社群資源，如果是自學難免孤單，加入他們的 Discord 之後，我找到一群學伴能互相打氣，讓我撐過前期的撞牆期。</li><li><a href="https://www.udemy.com/course/master-the-coding-interview-data-structures-algorithms/"><strong>Master the Coding Interview: Data Structures + Algorithms</strong></a><strong><br></strong> 上完第一堂課之後，可以開始準備資料結構跟演算法，這堂課就會帶你走過面試必考的題目，不只是囫圇吞棗，還會教你面試的技巧。我正在上這堂課，也非常推薦。</li><li><a href="https://www.udemy.com/share/101WH4A0AacFdWRXQ=/"><strong>Complete React Developer in 2020 (w/ Redux, Hooks, GraphQL)</strong></a><strong><br></strong> 最近在準備前端的面試，想把更深入了解 React 所以也開始上這堂課，這堂課有另外一個老師一起上，雖然我不太喜歡他的聲音（XD)，但不得不說這堂課的知識量又比第一堂多好多！</li></ol><p>其他還有一些 Zero to mastery 的課我也都趁特價的時候買了，如果有興趣的話可以等到打折再買，打完折只要美金9.99非常划算！</p><blockquote><em>如果你覺得這篇文章對你有幫助， </em><a href="https://www.udemy.com/share/100F3uA0AacFdWRXQ=/?xref=E0EYcF9bQXwJSWUuAAcqP1kSWSRM"><em>歡迎用我的連結註冊Udemy</em></a><em> ⬅️</em></blockquote><h4>3. <a href="https://lidemy.com/">Lidemy 鋰學院</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Lam-8IQ_AWdAdjhP.png" /></figure><p>胡立老師開的課大部分都是免費，而且非常面向新手！如果你因為上面的課程都是英文有點卻步，我也推薦從胡立老師的課程。我目前在上的是 <a href="https://lidemy.com/p/alg101-leetcode">先別急著寫Leetcode</a> ，老師講了很多很基礎、但是又非常重要的概念，對我開始刷題的第一步非常有幫助。我一開始會注意到這個資源是因為他有開 CS50 的中文跟讀班，他有很多其他課程，歡迎大家點進去看！</p><h3>Freecodecamp</h3><p><a href="https://www.freecodecamp.org/">Freecodecamp</a> 不是一個傳統影片教學的方式，而是把程式的內容分解成一小塊的模組，帶你一步步實際操作程式。而且他是免費的！！我自己已經上完 Responsive Web Design 的學程，也拿到了證書，目前正在上 JavaScript Data Structure &amp; Algorithm 的 Certificate。他的優點是教的很細，缺點也是教得很細，所以有時候學完就忘記了，我覺得這很適合當作複習的材料，讓你透過親手寫扣讓記憶更加深刻。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*gxeP9waVbfHMh9f2" /></figure><h4>恭喜你看到這邊，總共4820字！</h4><p>總之網路上資源非常多，也各有優缺點，我覺得更重要的是你是否能堅持下去把一堂課上到最後，我知道這很難，因為我目前完全上完的課也只有一堂XD 大家一起加油！如果有你覺得不錯的資源也歡迎在底下留言分享！</p><h4>About Roy</h4><p><strong>Social Media</strong><br> Facebook — <a href="https://roywang.pse.is/RoyFB">RoyWannago</a><br> Twitter -<a href="http://twitter.com/roywannago">@roywannago</a><br> Instagram 分享設計與程式學習 -<a href="https://www.instagram.com/royflwdesign/">@royflwdesign</a><br> Instagram 分享 UX 迷因 -<a href="https://www.instagram.com/UX_WTF/">@UX_WTF</a><br> YouTube 分享美國生活- <a href="https://roywang.pse.is/RoyYoutube">RoyWannago YouTube</a></p><p><em>Originally published at </em><a href="https://ithelp.ithome.com.tw/articles/10233767"><em>https://ithelp.ithome.com.tw</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3326ba1e5f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E5%AD%B8%E6%9C%83%E5%A6%82%E4%BD%95%E8%87%AA%E5%AD%B8%E6%98%AF%E9%82%81%E5%85%A5%E6%88%90%E5%8A%9F%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AD%A5-b3326ba1e5f8">學會如何自學是邁入成功的第一步</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[美國 USA｜從零到第一份實習 — UX 轉領域求職分享 (上)]]></title>
            <link>https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E7%BE%8E%E5%9C%8B-%E5%BE%9E%E9%9B%B6%E5%88%B0%E7%AC%AC%E4%B8%80%E4%BB%BD%E5%AF%A6%E7%BF%92-ux-%E5%AF%A6%E7%BF%92%E8%BD%89%E9%A0%98%E5%9F%9F%E6%B1%82%E8%81%B7%E5%88%86%E4%BA%AB-2019-%E4%B8%8A-d1eae1462c43?source=rss-ba3ef4ed6348------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1eae1462c43</guid>
            <category><![CDATA[美國留學]]></category>
            <category><![CDATA[usa]]></category>
            <category><![CDATA[實習]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Roy Wang]]></dc:creator>
            <pubDate>Thu, 06 Aug 2020 04:59:05 GMT</pubDate>
            <atom:updated>2020-09-06T05:28:06.808Z</atom:updated>
            <content:encoded><![CDATA[<h3>美國 USA｜從零到第一份實習 — UX 轉領域求職分享 (上)</h3><blockquote>我如何從零經驗的 UX 麻瓜，到找到第一份美國 UX 實習工作？</blockquote><p>這篇文章想要分享一下去年找實習的過程跟心得，雖然我不是特別厲害，但希望可以記錄一下轉領域到 UX 的心路歷程。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SFYY4nTDnTgNlx3F" /><figcaption>Photo by <a href="https://unsplash.com/@alvarordesign?utm_source=medium&amp;utm_medium=referral">Alvaro Reyes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>兩年前，第一次踏入密西根校園。當時我對 HCI 只有一些很粗淺的認識，只參與過一個研究計畫中的焦點團體、訪談、同理心地圖，但對於什麼設計過程、使用者測試、要怎麼把研究成果轉成設計圖都不清楚，更別談做出精美的 High-fid prototype。剛入學的時候曾想過走 data，但被 UX 背後的無限可能性給吸引：我想知道人們內心在想什麼，我想知道如何做出大家會需要、會喜歡又好用的東西，我想要把大學四年寫過的那些產品企劃案變成真實可以用的產品，於是乎，我走上了 UX 的修煉之路。</p><p>一年前，2019年的暑假，碩一正式結束。這一年間，我學了正式的訪談方式，從如何撰寫訪談稿、如何記筆記、如何不問出 leading questions、如何花了18小時將逐字稿換成一張張的便利貼，將研究中的 insight，轉換成可以執行的設計 guideline，最後向客戶呈現研究成果與建議。第一次跟跨領域專業合作，在兩個月內提出提案，帶領 4 位 MBA 同學走過設計流程，畫出設計稿、設計資訊架構，並用 Android Studio 跟 Firebase 做出一個真的可以動的 app；也跟工程學院同學合作，第一次要將之前留下來的研究成果轉為設計，並學習前端 Framework，同時身兼設計師跟工程師。人生第一次被同學說，<em>「你是設計專業，我希望你能多分享一些怎麼做，讓我們也可以學習」</em>，即使我才剛開始學 UX 不到一年。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9keY8WREjJ0CEU_z" /><figcaption>人生第一張 affinity wall</figcaption></figure><h3><strong>目錄</strong></h3><h4>上集（本文）</h4><ol><li>前言</li><li>求職三寶：履歷、作品、人脈</li></ol><h4>下集</h4><p>3. 面試過程分享</p><h3><strong>UX 求職三寶：履歷、作品集、人脈</strong></h3><p>在分享前先稍微提一下我的背景，我大學念台科大企管，大學實習經驗包括顧問公司營運助理、微軟行銷助理，打工做過電商相關的上架與經營、威秀影城，社團當過熱舞社文書。大學畢業後去了澳洲一年，做過許多農場、中餐館、工廠，最後在牧場做到小管理職，負責治療牛牛幫牛牛打針 XD。回台灣後，在台科做了健保相關案的研究助理。可以看得出來，我跟 UX 好像是完全沾不上邊的 XD</p><p>先說結論，我找實習的過程並不順利，從 2018 年底一路找到 2019年暑假開始一個月才拿到兩個 offer，拿到 offer 之後的一個禮拜就飛到波士頓開工。</p><p>畢竟什麼都是從頭開始，履歷、專案經驗、作品集，這些都是要花心力、時間累積的。</p><h4>1. 履歷：</h4><p>我本來的履歷是偏向行銷、或是為了申請學校做了 information science 相關的版本，但過去工作經驗中，沒有真正純正的 UX 設計相關經驗。於是我能做的就是將以前的經歷跟 UX 沾上邊的都抽絲剝繭的一一找出來。再來是，利用在學期間大量累積的專案經驗放上履歷，尤其強調跟 client 合作的經驗，表示我們設計不只是自己開心隨便做的，而是真的有跟業界接軌，也證明自己就算不是 native speaker，溝通能力也沒有問題。再來是格式也要調整成「設計師有的樣子」，從本來陽春的 word 檔，變成簡潔乾淨的設計師履歷，雖然有些人說沒有關係，但其實問過很多意見還是有關係的。畢竟是第一個門面，如果履歷跟作品集 visually 不好看，很難讓人聯想到你是個厲害的設計師？</p><h4>2. 專案：</h4><p>因為沒有UX經驗，在學時間的專案累積就非常重要。在第一學期就要鎖定能夠累積 project 的課程，並且一邊做一邊要記得搜集素材，設計過的每個草稿、不同版本，測試過的 feedback 這些都盡量記下來。</p><p>如果有機會，個人的、團體的設計專案都試試看，不同的專案會看中你不同面向的能力。再來，跟其他專業領域合作的經驗也很重要，我們學校有很多跨學院的 program，報名之後如果入選，你會被分配到不同的團隊裡面跟工程學院、商管、IOE、甚至藝術學院的同學合作，當然過程中不會很順利，因為你必須學會如何跟跨領域的團隊溝通，例如 UX 是什麼、為什麼 UX 重要、為什麼不斷的驗證設計、要怎麼樣快速修正等，這些能力都是實際工作時候會重要的軟實力。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GozgxOZ56N04SePC" /><figcaption>參加公司到學校辦的 Design Jam 也是一個很不錯的機會，又能認識新朋友，又能認識公司</figcaption></figure><p>我們學校提供非常多累積專案的機會，如果你是念密西根 HCI 的話，以下介紹幾個 Program：</p><ul><li><a href="https://mdp.engin.umich.edu/"><strong>Multidisciplinary design program (MDP)</strong></a></li></ul><p>這是跟 Engineering school 一起合作的一年 program，上下學期加起來 8 學分，分成業界組跟研究組。業界合作對象包括 Toyota、BOSCH、ProQuest、GM 等許多大咖公司。如果你想增加跟工程師合作的經驗，非常推薦此計畫。我參加的是研究組，設計改善學校開發的一個數據視覺化工具。</p><ul><li><a href="https://tauber.umich.edu/prospective-students/curriculum/integrated-product-development-course"><strong>Integrated Product Development (IPD)</strong></a></li></ul><p>如果你想參與開發產品從無到有的經驗，IPD 是一個一學期6學分的 Program。身為 Information school 代表，你會跟 Art &amp; Design, Business, Engineering 等學院的同學合作，組員據說是隨機分配的（刺激吧！）。你會花一學期的時間從市場研究、發想、設計、包裝到實作，最後在網路與實際 Trade show 賣最多的組別可以獲得開發獎學金！</p><ul><li><a href="https://www.si.umich.edu/programs/engaged-learning/volunteer-opportunities"><strong>Alternative Spring/Fall Break</strong></a><strong> (ASB/AFB)</strong></li></ul><p>ASB 是一個志願性的活動，學校會跟幾個城市（底特律、芝加哥、DC等）的非營利組織合作，專案類型從設計、資料分析、圖書資訊等都有，學校也接受學生自己提案，不一定是他們提供的對象也可以，學校會提供交通補助。Fall break (3天)跟 Spring break (7天)都有，我是參加 spring break 的因為覺得 fall break 時間太短。</p><p>2019 年的 ASB 我被分配到 Hellenic Museum of Michigan 的網頁設計專案，花了一週的時間快速的跟博物館基金會的爺爺奶奶們討論網站內容，並用 Squarespace 架出一個好維護的版本，<a href="https://www.hellenicmi.org/">成果在此</a>。這個小型博物館與其說是博物館，不如說是希臘同鄉會，住在底特律希臘裔第三代的爺爺奶奶還帶我們去 Greek Town 吃道地希臘料理、用會員身份帶我們免費進 DIA，真是有意義又有趣的專案！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VVY42M1UpA6USuk1" /><figcaption>Alternative Spring Break 一週的時間，在底特律希臘博物館當志工，重新設計博物館的網站，作品有上線唷：<a href="https://www.hellenicmi.org/">https://www.hellenicmi.org/</a></figcaption></figure><ul><li><a href="http://csed.engin.umich.edu/innovation-in-action/"><strong>Innovation in Action (IIA)</strong></a></li></ul><p>IIA 是一個 Socially engage design 的競賽，沒有學分，時間從 Fall semester 到三月，可以自己組隊，也可以先報名再配對。主題大致與社會關懷相關，是創新類的競賽，如果對創業有興趣可以參加。過程中會有許多 workshops 教你設計與創業相關的方法與資源，甚至還會提供許多與業界投資人午餐的機會，你可以利用半年的時間一步步把你的想法轉換成可以賣的 pitch。我也有參加這個，跟當時想搞新創的 MBA 同學一起組隊，甚至一路到決賽報告，還因疫情而改成線上簡報，可惜最後沒有得獎，此 program 一樣有提供資金給獲獎團隊。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eNIAoOz0WmKHXuZ_" /><figcaption>參加學校的 Social design 競賽，與不同學院的同學合作設計產品</figcaption></figure><ul><li><strong>Design clinic</strong></li></ul><p>Design clinic 是資訊學院特有的無學分專案，通常porject為一學期，參與的同學可以跟業界的公司合作。我自己沒有參加所以不知道詳細內容，不過也是一個累計作品的機會。</p><ul><li><a href="https://chi2021.acm.org/for-authors/students"><strong>CHI Student Competition</strong></a></li></ul><p>CHI 應該是 HCI 界無人不知的期刊研討會吧！之前每一年都會有 Student desgin competition，如果入決賽可以去研討會現場，讓人非常心動（誤），放在履歷或是作品集上也是很不錯的專案。</p><p>但是！從 CHI 2020 開始，取消了 Student design competition！！！！！</p><p>現在只剩下 <strong>Student Game Competition</strong> 跟 <strong>Student</strong> <strong>research</strong> <strong>competition</strong>！</p><p>於是乎，去年的我們就改作遊戲相關的設計，設計了一個<a href="https://www.royfalinwang.com/quipital-mobile-health">協助戒電子煙的遊戲 Quipital</a>，利用行為改變技術跟電子煙研究做了一個遊戲 prototype。雖然最後沒有入圍，但因為最後產出一篇paper要投稿，做的很扎實，又因為組員都是對健康有興趣的，所以這個題目也是非常的新穎有趣。如果能重來，希望我 2019 年就來得及參加呀～。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hjJvk88N5g73mIFx" /><figcaption><a href="https://www.royfalinwang.com/quipital-mobile-health">A MOBILE HEALTH GAME FOR CONTROLLING E-CIGARETTE USAGE</a></figcaption></figure><h4>3. 作品集：</h4><p>不要等到課程上完才開始做，一邊在做 project 就能一邊開始做作品集了！身為設計小白的我，一開始也不知道怎麼著手，這邊推薦最好的方式就是大量看優秀學長姐、前輩們的作品，尤其找出你想去的公司裡的 UX designer 的作品，學習他們的文字、排版、說故事的能力。這邊推薦幾個很好的作品集範例來源：</p><ul><li><a href="https://cofolios.com/"><strong>Cofolios</strong></a><br>這個網站集合了在各大科技公司設計 intern 的作品集，可以看各位大牛們的作品來知道自己到底多廢 XD</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EISTRMkdnq6zHF1P8rt5ow.png" /><figcaption>Cofolios.com</figcaption></figure><ul><li><a href="https://www.bestfolios.com/home"><strong>Bestfolios</strong></a><br>這網站不僅有許多優秀作品集，還有很多履歷、case study、文章等其他可以觀摩的作品！</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FVYC-RXd5OHsEYenuTZfUA.png" /><figcaption>Bestfolios.com</figcaption></figure><ul><li><strong>校友作品集</strong><br>校友作品集有個好處，能夠看學長姐如何把同一堂課的內容寫成讓雇主青睞的文案與呈現方式，也是很適合參考的來源。</li></ul><blockquote>以下分享我每次改作品集的心情：</blockquote><iframe src="https://www.instagram.com/p/CDdU0rrgCtU/embed/?cr=1&amp;amp;rd=https%3A%2F%2Fwww.instagram.com" width="658" height="957" frameborder="0" scrolling="no"><a href="https://medium.com/media/c97ca8234d62107073d35e4631dbdc09/href">https://medium.com/media/c97ca8234d62107073d35e4631dbdc09/href</a></iframe><p><strong>歡迎追蹤我經營的 UX meme IG 帳號: </strong><a href="https://www.instagram.com/ux_wtf/"><strong>@UX_WTF</strong></a><strong> ❤️ ，分享自製 UX 迷因、翻譯迷因、也歡迎投稿！</strong></p><h4>4. 人脈</h4><p>應該不用再強調人脈在美國找工作多重要了吧？我很喜歡的一句話，大概的意思是人生很多重要的關鍵，都是透過<strong>泛泛之交</strong>達成的；有另外一個名詞叫「弱連結」：</p><blockquote><em>社會學者葛蘭諾維特（Mark Granovetter）1974年發表的著名研究《求職》（Getting a Job），非常適合說明連結者的功能。葛氏從波士頓市郊的牛頓市挑出數百位專業及技術勞工， 仔細研究他們的求職經過。其中56%是透過自己的人脈找到工作；18.8%利用正式管道，例如廣告及獵人頭公司，另外約兩成的受訪者直接應徵。這個結果並不令人意外；求職最好是透過自己的人脈，先求入行。不過，葛蘭諾維特也發現，這些人脈大多屬於「泛泛之交」。利用個人關係找到工作的人，只有16.7%把這層個人關係視為「經常來往」的關係，求職者和介紹人並不算密友；55.6%的受訪者認為，雙方的關係只是「偶爾來往」； 認定雙方關係是「少有來往」的比率達到28%。因此，一般人不是靠朋友找到工作，靠的是一般的泛泛之交。</em></blockquote><blockquote><a href="https://www.storm.mg/article/2670577?page=2"><em>— 泛泛之交能介紹你工作？從「六度分隔理論」看「連結者」特質：《引爆趨勢：小改變如何引發大流行》選摘（2）-風傳媒</em></a></blockquote><p>結碖是，如果你是沒有什麼關係的留學生，多多認識班上同學、課上同學、室友、打工同事，對找工作會有幫助的！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LFil-jtaAT08paxd" /><figcaption>多交點朋友～Photo by <a href="https://unsplash.com/@brookecagle?utm_source=medium&amp;utm_medium=referral">Brooke Cagle</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>上篇大致分享了一些如果沒有經驗剛怎麼準備求職的前置動作，下一篇會分享我面試過的10家公司，說一下我遇過的 UX 面試方式，（不得不說這一行真的花式找工作呀，什麼關卡都有…），敬請期待下篇：</p><h4>美國｜從零到第一份UX實習 — UX 設計與研究實習面試心得</h4><h3>About Roy Wang</h3><blockquote><em>Hi, my name is Roy, a UX designer and a self-starter, who is passionate about HealthTech💉, user-centered design 🎨, and milk tea☕️.</em></blockquote><blockquote><em>Welcome to visit my portfolio website: </em><a href="http://royfalinwang.com/"><em>royfalinwang.com</em></a><em>, follow Instagram: </em><a href="https://instagram.com/royflwdesign/"><em>@royflwdesign</em></a><em>, and follow my Medium @roywannago !</em></blockquote><h3>Social Media</h3><blockquote><em>Facebook — </em><a href="https://roywang.pse.is/RoyFB"><em>RoyWannago</em></a></blockquote><blockquote><em>Twitter — </em><a href="https://twitter.com/roywannago"><em>@roywannago</em></a></blockquote><blockquote><em>Instagram 分享設計與程式學習 —</em></blockquote><blockquote>Instagram 分享 UX 迷因 — <a href="https://www.instagram.com/ux_wtf/">@UX_WTF</a></blockquote><blockquote><strong><em>YouTube 分享美國生活— </em></strong><a href="https://roywang.pse.is/RoyYoutube"><strong><em>RoyWannago YouTube</em></strong></a><strong><em> 🎬</em></strong></blockquote><h3>喜歡這篇文章你可以</h3><ol><li>★★★ 喜歡：<strong>拍手 5~10 下！</strong></li><li>★★★★很喜歡： <strong>拍手 10~30 下，分享給你朋友！</strong></li><li>★★★★★喜歡到不得了： <strong>拍手 30~100 下，幫我留言或分享給朋友！</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1eae1462c43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1/%E7%BE%8E%E5%9C%8B-%E5%BE%9E%E9%9B%B6%E5%88%B0%E7%AC%AC%E4%B8%80%E4%BB%BD%E5%AF%A6%E7%BF%92-ux-%E5%AF%A6%E7%BF%92%E8%BD%89%E9%A0%98%E5%9F%9F%E6%B1%82%E8%81%B7%E5%88%86%E4%BA%AB-2019-%E4%B8%8A-d1eae1462c43">美國 USA｜從零到第一份實習 — UX 轉領域求職分享 (上)</a> was originally published in <a href="https://medium.com/roywannago-%E6%97%85%E8%A1%8C%E4%B8%8D%E9%9C%80%E7%90%86%E7%94%B1">RoyWannago | 羅伊的強行自由計畫</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>