*博客头图：

RGB颜色，例如：#AFAFAF

Hover：

RGB颜色，例如：#AFAFAF

RGB颜色，例如：#AFAFAF

weixin_41826637的博客

• 博客(21)
• 收藏
• 关注

原创 Swift刷LeetCode 之 877-Stone Game-Med

Alex and Lee play a game with piles of stones. There are an even number ofpilesarranged in a row, and each pile has a positive integer number of stonespiles[i].The objective of the game is to end with the moststones. The total number of stones is o...

2020-09-20 10:53:20 16

原创 Swift刷LeetCode 之 1561-Maximum Number of Coins You Can Get-Med

There are 3npiles of coins ofvarying size, you and your friends will take piles of coins as follows:In each step, you will chooseany3 piles of coins (not necessarily consecutive). Of your choice,Alicewill pickthe pile with the maximum number of c...

2020-08-27 00:24:25 28

原创 Swift刷LeetCode 之 1539-Kth Missing Positive Number-Easy

Given an arrayarrof positive integerssorted in astrictly increasing order, and an integerk.Find thekthpositive integer that is missing from this array.给定一个按严格递增顺序排序的正整数数组arr和一个整数k。找出这个数组中丢失的第k个正整数。Example 1:Input: arr = [2,3,4,7,11], k...

2020-08-24 12:16:03 87

原创 Swift刷LeetCode 之 1544-Make The String Great-Easy

Given a stringsof lower and upper case English letters.A good string is a string which doesn't havetwo adjacent characterss[i]ands[i + 1]where:0 <= i <= s.length - 2 s[i]is a lower-case letter ands[i + 1]is the same letter but in upper...

2020-08-20 10:26:40 38

2020-08-20 03:19:51 137

原创 iOS/Xcode问题之Command CodeSign failed with a nonzero exit code或者Revoke certificate

2020-08-20 00:47:31 105

原创 Swift刷LeetCode 之 1550-Three Consecutive Odds-Easy

Given an integer arrayarr, returntrueif there are three consecutive odd numbers in the array. Otherwise, returnfalse.给定一个整数数组arr，如果数组中有三个连续的奇数，则返回true。否则,返回false。Example 1:Input: arr = [2,6,4,1]Output: falseExplanation: There are no three cons...

2020-08-19 10:56:01 38

原创 Swift刷LeetCode 之 14-Longest Common Prefix-Easy

Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".编写一个函数来查找字符串数组中最长的公共前缀字符串。如果没有公共前缀，返回一个空字符串""。Example 1:Input: ["flower","flow","flight"]Output: "fl".

2020-08-19 10:38:00 19

原创 Swift刷LeetCode 之 4-Median of Two Sorted Arrays-Hard

There are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assumenums1andnums2cannot be both empty.有两个大小分别为m和n的编号为s1和编号为s2的排序数组...

2020-08-18 11:47:16 36

原创 Swift刷LeetCode 之 9- Palindrome Number-Easy

Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.确定一个整数是否是回文。一个整数是一个回文，当它读取相同的向后和向前。Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanation: From left ...

2020-08-18 10:40:20 29

原创 Swift刷LeetCode 之 7- Reverse Intege-Easy

Given a 32-bit signed integer, reverse digits of an integer.给定一个32位有符号整数，整数的反向数字。Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing with an environment which co

2020-08-17 11:25:59 20

原创 Swift刷LeetCode 之 3- Longest Substring Without Repeating Characters-Med

Given a string, find the length of thelongest substringwithout repeating characters.给定一个字符串，查找不重复字符的最长子字符串的长度。Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:Input: "bbbbb"Output: 1Ex..

2020-08-17 10:29:36 27

原创 Swift刷LeetCode 之 2-Add Two Numbers-Med

Given给定* public class ListNode {* public var val: Int* public var next: ListNode?* public init() { self.val = 0; self.next = nil; }* public init(_ val: Int) { self.val = val; self.next = nil; }* public init(_ val: Int, _ ...

2020-08-15 01:01:55 48

原创 Swift刷LeetCode 之 1-Two Sum-Easy

Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.给定一个整数数组，返回两个数字的索引，使它们加起来成为一个特定的目标。You may assume that each input would haveexactlyone solution, and you may not use thesameelement twice.您可能...

2020-08-14 12:56:42 28

原创 View生命周期之viewWill/DidAppear()， viewWill/DidDissappear() &解决问题Fatal error: Unexpectedly found nil

viewDidLoad() -> viewWillAppear() -> viewDidAppear() -> viewWillDissappear() -> viewDidDisappear() 有ViewController1和ViewController2.两个关系如下，点击click, view1 -> view2, 点击back, view2 -> ...

2020-03-16 01:00:48 40

原创 navigationController.pushViewController(viewController: UIViewController, animated: Bool) 不起作用

2020-02-05 08:21:50 308

原创 使用Firebase, observe 和 observeSingleEvent的区别

Firebase Realtime数据库是一个NoSQL数据库，可以用来存储和检索我们的应用程序的数据。数据存储为JSON，整个数据库可以看作是一个巨大的JSON树。数据写在由相对路径(关联键)定义的特定位置，可以使用相同的路径检索。随着数据被添加到JSON树中，它将成为现有JSON结构中的一个节点。使用DatabaseReference的observe(_:with)或obs...

2020-01-29 01:59:09 118

原创 不用storyboard创建新项目之SceneDelegate.swift (Xcode 11 & IOS 13)

2019-12-31 02:02:45 1172 1

原创 为什么要用Github以及如何注册和使用Github去Push项目到Repository

GitHub GitHub是由Linux系统所创建的工具，名为git，由创建Linux本身的人Linus Torvalds。对于无论是开发人员还是使用开源软件的人。，它是开源软件的自动供应链。Github更像是一个集市，而集市内的摆摊者-就是程序员，算法分析师，数据分析师等有好想法和需要合作的人。一个好汉三个帮，GitHub既可以是一个小范围组织或个人的工作场所，也是一个具有各种open sour...

2018-07-11 09:20:01 266

原创 Python module（模块安装问题）No module named "XXX" （比如numpy，等等）

Python最强大的功能之一在于对与模块的兼容性，这也导致了尽管Python属于相对“简单”语言，但因兼容各种功能性模块，使得Python可以完成众多任务，因此Python又被称为胶水语言（能够把其他语言制作的模块融合为自己所用）。      对于一个新安装的Python软件来说，除了基本库，是没有其他功能的，在导入我们需要库的时候会提示No module named "XXX"。如何解决...

2018-07-09 11:10:57 41265 1

翻译 Python和Machine Learning之 Pycharm软件：Cannot import name 'mpl' from 'matplotlib'

Pycharm软件在安装之初并没有导入我们所需module（模块），如果我们想用matplotlib模块并已经从相应网站成功下载，安装，导入到软件里。在使用from matplotlib import mpl去导入在project里，会出现如下错误：    ...

2018-07-09 10:43:52 1466

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝