討論串[閒聊] 每日leetcode
共 319 篇文章

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者yam276 (史萊哲林的優等生)時間2月前 (2024/03/11 22:02), 編輯資訊
0
0
1
內容預覽:
差不多思路. 先建order map. 然後把str變成Vec比對order map. 不在order map就塞後面. 最後拼回來. use std::collections::HashMap;. impl Solution {. pub fn custom_sort_string(order:
(還有341個字)

推噓2(2推 0噓 5→)留言7則,0人參與, 2月前最新作者DJYOSHITAKA (franchouchouISBEST)時間2月前 (2024/03/11 22:53), 2月前編輯資訊
0
0
0
內容預覽:
791. Custom Sort String. 你板大師都好猛. 剩我只會水桶了. string customSortString(string order, string s) {. vector<int> cnt(26,0);. for(auto c : s). {. cnt[c-'a']++
(還有233個字)

推噓2(2推 0噓 2→)留言4則,0人參與, 2月前最新作者JIWP (神楽めあ的錢包)時間2月前 (2024/03/11 23:00), 編輯資訊
0
0
0
內容預覽:
你版都好猛,剩我剛才才想起來今天每日還沒寫了. C code怎麼這麼難寫. char* customSortString(char* order, char* s) {. char *res=(char*)malloc(sizeof(char)*(strlen(s)+1));. res[strlen
(還有432個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 2月前最新作者Rushia (みけねこ的鼻屎)時間2月前 (2024/03/12 11:00), 編輯資訊
0
1
1
內容預覽:
https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list1171. Remove Zero Sum Consecutive Nodes from Linked List. 給你一個鏈結串列,如果子
(還有1070個字)

推噓3(3推 0噓 2→)留言5則,0人參與, 2月前最新作者DJYOSHITAKA (franchouchouISBEST)時間2月前 (2024/03/12 23:18), 2月前編輯資訊
0
0
0
內容預覽:
你板大師到底怎麼想到這些奇技淫巧的. 我只能想到全部traverse一遍然後開始慢慢DP. 剩我想不出prefix sum這種高級技巧了. 去漬了. --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.171.13.229 (臺灣). 文章網址: https://www.ptt.c
(還有36個字)