討論串[閒聊] 每日LeetCode
共 719 篇文章
內容預覽:
為了下次codility不要烙賽. 再寫一題. map真好用. 49. Group Anagrams. class Solution {. public:. vector<vector<string>> groupAnagrams(vector<string>& strs) {. vector<ve
(還有332個字)
內容預覽:
https://leetcode.com/problems/evaluate-reverse-polish-notation. 150. Evaluate Reverse Polish Notation. 回傳逆波蘭表示法的結果值. 有效運算子為 "+" "-" "*" "/". 每個操作數會是整數
(還有1079個字)
內容預覽:
原本以為要用queue就取叫q. 寫到一半發現是stack懶得改就繼續q了. class Solution {. public:. int evalRPN(vector<string>& tokens) {. vector<int> q;. for(const string& t:tokens){.
(還有823個字)
內容預覽:
150.Evaluate Reverse Polish Notation. 直接看example. Input: tokens = ["2","1","+","3","*"]. Output: 9. Explanation: ((2 + 1) * 3) = 9. C# code:. https://
(還有1097個字)
內容預覽:
寫完後發現去年5月寫過了. 那時候應該是抄某個答案的. 結果我一年後再寫一遍 一模一樣. 答案直接背起來 笑死. class MyQueue {. public:. stack<int> in;. stack<int> out;. MyQueue() {. }. void push(int x) {
(還有420個字)