https://leetcode.com/problems/palindrome-number/description/ palindrome-number: 回文数 , 简单理解就是对称数 解决: 每次取到第一个数和最…
标签:LeetCode swift
Swift LeetCode 系列之4: Median of Two Sorted Arrays(未完)
https://leetcode.com/problems/median-of-two-sorted-arrays/description/ 首先理解什么是中位数, 最简单的理解就是位置在最中间的那个数, 当数组长度为奇…
Swift LeetCode 系列之 13: roman-to-integer
https://leetcode.com/problems/roman-to-integer/description/ class Solution { func romanToInt(_ s: String) ->…
Swift LeetCode 系列之 19: mergeTwoLists
https://leetcode.com/problems/merge-two-sorted-lists/description/ 将两条有序的链表合并为一条有序的链表 时间复杂度0(m+n) m, n 为链表的长度 /…
Swift LeetCode 系列之 7: Reverse Integer
title: ‘Swift LeetCode 系列之 7: Reverse Integer’date: 2017-07-21 10:31:48tags: 本篇文章我是LeetCode 系列之第一篇…
Swift LeetCode 系列之 1: TwoSum
典型的hashMap 解决方法 class Solution { func twoSum(_ nums: [Int], _ target: Int) -> [Int] { var dic = [Int: Int](…
Swift LeetCode 系列之 2: add-two-numbers
https://leetcode.com/problems/add-two-numbers/description/ /** * Definition for singly-linked list. * public c…
Swift LeetCode 系列之 19: Remove Nth Node From End of List
https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/ 利用快慢指针快速定位到要删除节点的位置 /** * Definiti…