作者cplusplus426 (c++)
看板Python
标题[问题] leetcode 格式
时间Mon Sep 25 16:15:51 2017
大家好,最近开始预备在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://webptt.com/cn.aspx?n=bbs/Python/M.1506327353.A.DE6.html
1F:推 pups003: 要保留 09/25 18:09
2F:→ Carlchen: 它用class叫function input test data,所以要留 09/25 19:22
3F:→ TitanEric: leetcode都这样喔 建议可以看个说明 09/25 23:28