這次 11.18 的 Akuna OA ,我們這邊帶的幾位同學整體回饋都比較一致:題目不難,但寫得是否乾淨俐落,差距一下就拉開了。 Akuna 本身對程式碼品質、思路完整性非常敏感,所以這份解析我們依照真實做題體驗做了複盤,希望能給後來人一個更清晰的參考

Problem 1 — Find the shortest lexicographically smallest substring containing k ‘I’
Given a string s and an integer k, return the shortest substring of s that contains at least k occurrences of the character 'I'.
If multiple substrings have the same shortest length, return the lexicographically smallest one.
這題屬於典型的「不要想複雜,直接寫就好」的類型
問題概要:
給你字串 s 和整數 k,要找一個 substring,裡面至少/剛好含 k 個'I'
在所有满足条件的子串里:
先比長度(越短越好)
长度相同再比字典序
我們建議的穩定思路:
外層 loop 枚舉每個起點 i
裡層往後掃,直到湊夠 k 個'I'
只要滿足條件就把當前 substring 記下來
最後對所有 substring 排序:
length → lexicographical order
這種寫法易寫、易 debug,也方便在壓力環境下快速 AC
Problem 2 — Compute accumulated left-side differences for each element
For an array arr of size n, for each position i, compute a value:
- For every
j < i:- If
arr[j] < arr[i], add(arr[i] - arr[j]) - Else subtract
(arr[j] - arr[i])
- If
Return the result array of size n.
這題我們帶學員遇過非常多次,本質就是一個 O(n²) 的穩定題,不需要花俏優化。
問題概要:
給數組 arr,對每個位置 i:
- 遍歷所有
j < i - 如果
arr[j] < arr[i]→ 加(arr[i] - arr[j]) - 如果
arr[j] > arr[i]→ 减(arr[j] - arr[i])
最後把每個位置累積出來的結果塞回 result 數組
實戰可交付方案:
- 兩層循環直接寫
- 邊界特別清晰,不容易寫錯
- 面對任何 tricky input 都不會翻車
對於 Akuna,穩和準永遠比炫技更重要
Problem 3 — Find the maximum-weight k-star subgraph
You are given a weighted undirected graph.
Each node has a weight.
A k-star is defined as choosing one node as the center and selecting up to k of its neighbors.
The score of this star is:
center_weight + sum of the weights of the selected neighbors
Only neighbors with positive weight should be selected.
Return the maximum score over all possible centers.
這是 Akuna 一直愛考的“輕圖論+ 直覺貪心”
問題概要:
- 給加權圖
- 選一個節點做中心
- 從鄰居挑最多
k個正權值節點 - 得分= 中心權值+ 前 k 個鄰居權值之和
- 要最大化這個得分
Programhelp 給學員的通關方案:
- 使用鄰接表存圖
- 對每個節點:
- 把所有鄰居權值抓出來
- 從大到小排序
- 取前 k 個正值
- 計算總和,更新最大值
思緒清爽、寫法不容易亂,是那種「寫完基本上穩過」的標準解
從迷惘到上岸,我們都能陪你走
如果你這段時間也在準備 Akuna、HRT、Citadel、Optiver 這些 Quant/Trading 系列的 OA 或 VO,其實你完全不用一個人硬扛。我們今年已經陪著許多同學從入門到穩穩上岸,最大的收穫就是:
只要有人幫你把題型、節奏、注意事項兜住,你的表現會比你想像得更穩定
- 透過 ToDesk 遠端連線
- 在你的環境裡無痕處理整個 OA 流程
- 所有測試案例 100% 通過,否則不收費
- 适用于各类 OA 平台(HackerRank / CodeSignal / Codility / HireVue code 等)
重點是:
整個過程不會留下任何痕跡,也不會被平台偵測到,真正做到穩、快、乾淨。
如果你現在正被某個 OA 卡著、或擔心因為時間壓力翻車,完全可以來聊聊你的狀況,我們會根據題型幫你規劃最穩的通關方式。