2024 年 12 月

[Leetcode] 2402. Meeting Rooms III

ou are given an integer n. There are n rooms numbered from 0 to n – 1.

You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the values of starti are unique.

Meetings are allocated to rooms in the following manner:

Each meeting will take place in the unused room with the lowest number.
If there are no available rooms, the meeting will be delayed until a room becomes free. The delayed meeting should have the same duration as the original meeting.
When a room becomes unused, meetings that have an earlier original start time should be given the room.
Return the number of the room that held the most meetings. If there are multiple rooms, return the room with the lowest number.

A half-closed interval [a, b) is the interval between a and b including a and not including b.

[Leetcode] 2402. Meeting Rooms III Read More »

Leetcode, 技術文章
Cursor AI

Cursor AI:從新手到專業工程師都適用的 AI 編輯器,該怎麼使用?

寫程式的過程,對不同程度的人來說,挑戰各有不同,舉例來說:
新手 可能在語法上卡關,花大量時間找出簡單錯誤,甚至不知道該如何開始。
工程師 追求的是高效開發,減少重複性工作,避免瑣碎的錯誤拖慢進度。
產品設計師 和 產品經理 則希望可以快速驗證想法,但程式語法對他們來說門檻較高。
傳統的程式碼編輯器已經有一定的功能,但面對這些問題,仍有許多進步空間。而 Cursor 這款結合 AI 的程式碼編輯器,正是為了解決這些痛點而誕生,讓寫程式變得更高效、更直覺,也更容易學習。
本篇文章將會介紹 Cursor 背後的創辦動機、使用方式,並與其他編輯器進行比較,說明它的侷限與最佳使用場景,還有未來 AI 編輯器的發展趨勢,一起看下去吧!

Cursor AI:從新手到專業工程師都適用的 AI 編輯器,該怎麼使用? Read More »

軟體工程師, ,

[Leetcode] 0057. Insert Interval

You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti. You are also given an interval newInterval = [start, end] that represents the start and end of another interval.

Insert newInterval into intervals such that intervals is still sorted in ascending order by starti and intervals still does not have any overlapping intervals (merge overlapping intervals if necessary).

Return intervals after the insertion.

Note that you don’t need to modify intervals in-place. You can make a new array and return it.

[Leetcode] 0057. Insert Interval Read More »

Leetcode, 技術文章
zh_TW繁體中文