8. 字符串转换整数 (atoi) class Solution(object): def myAtoi(self, s): """ :type s: str :rtype: int """ s = s.strip() if len(s) == 0: return 0
6. Z 字形变换 class Solution(object): def convert(self, s, numRows): """ :type s: str :type numRows: int :rtype: str """ if len(s) == 1 or numRows == 1:
4. 寻找两个正序数组的中位数 class Solution(object): def findMedianSortedArrays(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: float """
注:标题即题目链接 1. 两数之和 我采取了暴力的遍历方法: class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """
LeetCode解题思路
博客
泡泡
积分
勋章
LeetCode记录04
LeetCode记录03
LeetCode记录02
LeetCode记录01
第三方账号登入
看不清?点击更换
第三方账号登入
QQ 微博 微信