在蔚藍海岸寫下七天的日記:尼斯慢旅手記
前言|蔚藍海岸的召喚:我們為什麼選擇尼斯?這趟旅行的起點,其實只是某天和朋友們閒聊時,隨口問了一句:「放假要不要去哪裡玩?」沒想到一聊成真,最後我們決定來一趟南法自駕之旅,而尼斯成了我們毫不猶豫的首選。
決定要去尼斯之後,有朋友推薦我去看 Netflix 上的日本戀愛實境節目《離線找真愛》。節目中多次出現尼斯的街景與海岸,那片蔚藍的海、悠閒的氛圍,和我們即將踏上的旅程不謀而合,也讓我對這座城市的期待更深了一層。
尼斯,是法國南部的一座海濱小城,節奏悠閒、氣氛輕柔,是個非常適合放鬆心情、親近海岸的地方。這裡被稱作「蔚藍海岸」(Côte d’Azur),一踏上這片土地你就會明白,這個名字一點都不誇張。
走過這一趟,我真心覺得:尼斯是一座會讓人愛上的城市。她有氣質,也有魅力,靜靜地等待著你來發現她的美好。
行程總覽|7 天尼斯與蔚藍海岸探索路線全覽
Day 1|抵達尼斯:取車後前往市區,展開旅程從尼斯機場抵達後順利取車,沿著海岸駛入市區,入住民宿,為接下來幾天的探索做好準備。
Day 2|邊境雙城:Menton 的彩色街景與 Monaco 的奢華海港一路東行,造訪義法邊境的陽光小鎮 M ...
2130. Maximum Twin Sum of a Linked List
Leetcode Link
This problem can be approached using the reverse linked list technique.If you haven’t solved Leetcode 206 before, I recommend doing that first to get familiar with how to reverse a singly linked list.
Input: head = [4,2,2,3]Output: 7
Since the twin sum is defined as summing the i-th node from the start with the i-th node from the end (for a list of even length), we can reverse the linked list to simulate accessing nodes from the back.
Original: [4, 2, 2, 3]Reversed: [3, 2, 2 ...
739. Daily Temperatures
Leetcode Link
A brute-force solution would use two nested loops to compare each day’s temperature with the upcoming days, resulting in O(n²) time complexity, which is inefficient for large inputs.
To optimize this, we can use a monotonic stack to store temperature information, reducing the time complexity to O(n).
Input: temperatures = [73,74,75,71,69,72,76,73]Output: [1,1,4,2,1,1,0,0]
Step-by-step Stack Simulation:We first initialize a result array of the same length, filled with 0s:
res ...
Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Leetcode Link
ConceptEvery day, we have two choices: either hold a stock or sell a stock.
Holding a stock means we either bought it on a previous day or purchased it today.Selling a stock means we either still have cash from previous transactions or we sold a stock today.To solve this problem efficiently, we can use dynamic programming.
Understanding the ProblemGiven an array prices where prices[i] represents the stock price on the ith day, and an integer fee representing the transaction fee, ...
Leetcode 216 Combination Sum III
Leetcode Link
AnalysisIf we start with ( k = 3 ) and ( n = 9 ), we need to find all possible combinations of three distinct numbers from ( 1 ) to ( 9 ) that sum up to ( 9 ).
For example, the valid combinations are:
([1, 2, 6]) → sum = 9 ✅
([1, 3, 5]) → sum = 9 ✅
([2, 3, 4]) → sum = 9 ✅
This problem is similar to the subsets problem, where we explore different combinations by picking each number one at a time. The key difference is that we need to ensure the s ...
Leetcode 62 Unique Paths
Leetcode Link
To understand this problem, let’s begin by considering a simple example: a 2x2 maze. In this maze, you can only move right or down. To reach the bottom-right corner ([1, 1]), there are two possible paths:
Right → Down
Down → Right
Thus, we can conclude that for a 2x2 maze, there are 2 unique paths to reach the bottom-right corner.
Extending to Larger GridsLet’s consider a larger grid, such as a 3x7 maze. We can construct a matrix to represent the number of ways to reach each ...
Leetcode 735 Asteroid Collision
Leetcode Link
We can use a stack to solve this problem.
From the problem description, the planets move at the same speed, so we only need to consider their direction and size.Whether two planets will collide and the result of the collision can be divided into three cases:
asteroids = [5, 10] or asteroids = [-5, -10]
Both planets move in the same direction, so no collision occurs.
asteroids = [-5, 10]
The two planets move in different directions but will not collide.
asteroids = ...
Cloud Summit 2024 Participation Experience
OverviewAttending Cloud Summit for the first time allowed me to gain a deeper understanding of cloud technologies. I am quite happy to see that the industry has many new tools and technologies that simplify complex tasks, continuously pushing the capabilities of Taiwan’s software industry.
Of course, a speaker who discussed the double-edged nature of the Cloud, highlighting both its advantages and disadvantages. In this era of AI, technological iterations are happening rapidly, but the unchang ...
Two Ways to Set Up a Firewall in Linux
Firewall ConfigurationOn Ubuntu Linux, you can use ufw or iptables for firewall configuration. Here are the commands and some pitfalls I encountered along the way. 🤣
UFW
View firewall settings sudo ufw status
Add firewall rules # allow sshsudo ufw allow ssh# allow specific ip to specific portsudo ufw allow from 123.123.123.123 to any port 22/tcp
List firewall rules with numbers sudo ufw status numbered
Example root@localhost:~# sudo ufw status numberedStatus: active To ...
The maps below show an industrial area in the town of Norbiton, and planned future development of the site.
The two maps illustrate the variation in Norbiton town, showing the current industrial usage and the proposed future refurbishment of the area.
Overall, it is evident that there will be more accommodations and numerous facilities replacing the factories in the town.
Upon closer examination of the maps, many factories are situated along the routes, and there are still significant unused spaces. These factories will be replaced by a plethora of new apartments or flats to accommodate the rising p ...