LeetCode - 計算1加到n的總和
題目計算1加到n的總和,例如: n為10,總和為1+2+3+4+5+6+7+8+9+10=55。
解法一時間複雜度: O(n)
12345678910111213141516171819202122232425262728293031"""透過數學累加方式進行計算總和若n=10計算方式:0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55步驟1 => total + 1 => 0 + 1 = 1步驟2 => total + 2 => 1 + 2 = 3步驟3 => total + 3 => 3 + 3 = 6步驟4 => total + 4 => 6 + 4 = 10步驟5 => total + 5 => 10 + 5 = 15步驟6 => total + 6 => 15 + 6 = 21步驟7 => total + 7 => 21 + 7 = 28步驟8 => total + 8 => 28 + 8 = 3 ...
LeetCode - 列印abc所有排列組合
題目給定一個字串,列印出所有可能的組合,例如: abc -> aaa, aab, aac, aba, abb, abc, aca, acb, acc, baa, bab, bac, bba, bbb, bbc, bca, bcb, bcc, caa, cab, cac,cba, cbb, cbc, cca, ccb, ccc
解法一123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110"""思路in_put = 'abc'n = 3個字元組合數量 = n^n = 3^3 = 27Big O: O(n^n)"""def ...
今日開張
主要筆記:
程式專案:專案過程研究的技術、架構、與遇到的問題分享。
金融知識
工具分享
Keyword1234金融知識, Knowledge of finance, know-l-edge of fin-ance架構, Architecture, arch-itec-ture研究過程, Research process, re-search pro-cess技術, Technology, tech-no-logy
常用單字
12345678910111213141516171819202122232425262728293031323334353637383940414243Android: - 縱向, portrait, port-rait - 橫向, landscape, land-scape - 方向, orientation, o-rien-ta-tion - 曲線, spline, sp-lineIT: - 副駕駛, copilot, co-pi-lot - Stock: - 股票, Stock - Politics: - 政治, Politics - 民主黨, Democracy party, demo-cracy party - 共和黨, Republicans party, re-pub-li-cans partySSLMMS: - 電壓, Voltage, vol-tage - 電流, Current, cur-rentLovbabi: - The log is bound to the student model.Education: - Natio ...