[問題] leetcode 格式

看板Python作者 (c++)時間6年前 (2017/09/25 16:15), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/1
大家好,最近開始預備在leetcode練習, 先挑了一個非常簡單的題目,也很快就做出要求 但發現正式提交後卻出現了Runtime error的情況, 難道說leetcode的程式編輯區格式要完整的保留嗎 ? 以下是原格式 class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ 我想說這程式才幾行而已幹嘛用Class 就只寫Function和輸出輸入而已 。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.177.12.57 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1506327353.A.DE6.html

09/25 18:09, , 1F
要保留
09/25 18:09, 1F

09/25 19:22, , 2F
它用class叫function input test data,所以要留
09/25 19:22, 2F

09/25 23:28, , 3F
leetcode都這樣喔 建議可以看個說明
09/25 23:28, 3F
文章代碼(AID): #1PoBivtc (Python)