摘要:
只出現一次的數字(136) class Solution { public int singleNumber(int[] nums) { int res = 0; for (int num : nums){ res ^= num; } return res; } } 分析 異或 多數元素(169) 閱讀全文
posted @ 2025-06-27 17:39
crhl-yy
閱讀(40)
評論(0)
推薦(0)
摘要:
我是比較愛用自底向上的自底向上方法不會計算多余情況, 也不用memo存儲 不同路徑(062) class Solution { public int uniquePaths(int m, int n) { int[][] dp = new int[m][n]; for (int i = 0; i < 閱讀全文
posted @ 2025-06-27 14:11
crhl-yy
閱讀(43)
評論(0)
推薦(1)
浙公網安備 33010602011771號