2025-04-20发表2025-04-21更新leetcode / 每日一题1 分钟读完 (大约123个字)0次访问leetcode-781题目题目链接 分析 记录每个不同的answer// 每个answer表示有answer+1个这种颜色的兔子(有answer只兔子的颜色和本兔子相同)// (answer+answer_num)/(answer+1)表示兔子相同的颜色数// 即 有k种颜色的兔子数量 为 answer// 所有 :$\sum_{i=1}^{n}$ 颜色i *对应兔子数(answer) = 最终答案 源代码源代码 leetcode-781https://norton-lin.github.io/2025/04/20/LeetCode/leetcode-781/作者Norton-Lin发布于2025-04-20更新于2025-04-21许可协议leetcode哈希