自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(68)
  • 收藏
  • 关注

原创 【算法】Longest Substring Without Repeating Characters 最长无重复字符子串

【算法】Longest Substring Without Repeating Characters 最长无重复字符子串题目解题思路代码实现题目Given a string, find the length of the longest substring without repeating characters.Example 1:Input: “abcabcbb”Output: 3...

2020-04-22 19:19:16 200

原创 【算法】Nth Magical Number 第N个神奇数字

【算法】Nth Magical Number 第N个神奇数字题目解题思路代码实现题目A positive integer is magical if it is divisible by either A or B.Return the N-th magical number. Since the answer may be very large, return it modulo 10^...

2020-04-07 22:08:49 285

原创 【算法】Self Crossing 自我相交

【算法】Self Crossing 自我相交题目解题思路代码实现题目You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south,...

2020-03-30 12:54:22 693

原创 【算法】Best Time to Buy and Sell Stock IV 交易股票嘴角时机4

【算法】Best Time to Buy and Sell Stock IV 交易股票嘴角时机4题目解题思路代码实现题目Say you have an array for which the i-th element is the price of a given stock on day i.Design an algorithm to find the maximum profit. Y...

2020-03-23 21:23:15 150

原创 【算法】Longest Valid Parentheses 最长有效括号

【算法】Longest Valid Parentheses 最长有效括号题目解题思路代码实现题目Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.Example 1:Input:...

2020-03-18 12:43:43 105

原创 【算法】Create Maximum Number 创建最大数

【算法】Create Maximum Number 创建最大数题目解题思路代码实现题目Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The ...

2020-03-10 18:16:59 342

原创 【算法】Regular Expression Matching 正则匹配

【算法】Regular Expression Matching 正则匹配题目解题思路代码实现题目Given an input string ( s ) and a pattern ( p ), implement regular expression matching with support for ‘.’ and ‘*’.‘.’ Matches any single character....

2020-03-03 10:59:07 182

原创 【算法】Super Egg Drop 鸡蛋掉落

【算法】Super Egg Drop 鸡蛋掉落题目解题思路代码实现题目You are given K eggs, and you have access to a building with N floors from 1 to N.Each egg is identical in function, and if an egg breaks, you cannot drop it agai...

2020-02-27 07:52:16 539

原创 【算法】Decode Ways II 解码方式2

【算法】Decode Ways II 解码方式2题目解题思路代码实现题目A message containing letters from A-Z is being encoded to numbers using the following mapping way:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Beyond that, now the enc...

2020-02-22 17:55:45 156

原创 【算法】Split Array With Same Average 拆分数组为两个平均值的子数组

【算法】Split Array With Same Average 拆分数组为两个平均值的子数组题目解题思路代码实现题目In a given integer array A, we must move every element of A to either list B or list C. (B and C initially start empty.)Return true if an...

2020-02-15 17:32:55 394

原创 【算法】Integer to English Words 数字转换单词

【算法】Integer to English Words 数字转换单词题目解题思路代码实现题目Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 2^31 - 1.Example 1:Input: 123Output: “...

2020-02-06 00:17:42 260

原创 【算法】Text Justification 文本对齐

【算法】Text Justification 文本对齐题目解题思路代码实现题目Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified.You ...

2020-01-24 21:25:24 217

原创 【算法】Substring with Concatenation of All Words 所有单词链接而成的子串

【算法】Substring with Concatenation of All Words 所有单词链接而成的子串题目解题思路代码实现题目You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s)...

2020-01-23 12:02:25 124

原创 【算法】Shortest Subarray with Sum at Least K 求数组中区间和大于等于 K 的最小子数组长度

【算法】Shortest Subarray with Sum at Least K题目解题思路代码实现题目Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K.If there is no non-empty subarray with sum at least K...

2020-01-06 15:55:29 442

原创 Mac 下安装配置 iTerm 和 oh-my-zsh

Mac 下安装配置 iTerm 和 oh-my-zshiTerm是什么iTerm 安装iTerm 修改配色oh-my-zsh 是什么oh-my-zsh 安装oh-my-zsh 主题安装插件快速提示补齐目录插件:incr快速跳到常用目录:autojump自动补全以前输入过的命令:zsh-autosuggestionsiterm2 中复制命令特别卡iTerm是什么简单来说 Mac 自带的 term...

2019-12-31 17:11:47 510

原创 【算法】Reverse Pairs 翻转对,BIT 解法

文章目录题目解题思路代码实现题目Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the given array.Exa...

2019-12-31 11:55:48 391

原创 吃透 Binary Indexed Trees (树状数组)

Binary Indexed Trees(中文名为树状数组,下文简称为BIT)是一种特殊的数据结构,适用于高效计算数列的前缀和, 区间和。时间复杂度:任意前缀和、区间和:O(logn)单点值修改:O(logn)空间复杂度: O(n) 。虽然 BIT 名称中带有 tree 这个词,但是实际存储时是利用数组进行存储,记nums为原始数组和 BIT为 BIT 数组。BIT[i]=∑k=i...

2019-12-31 11:52:09 203

原创 【算法】Reverse Pairs 翻转对,merge sort 解法

文章目录题目解题思路代码实现题目Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the given array.Exa...

2019-12-26 12:05:46 269

原创 【算法】Wildcard Matching通配符匹配

文章目录题目解题思路代码实现题目Given an input string (s) and a pattern §, implement wildcard pattern matching with support for ‘?’ and ‘*’.‘?’ Matches any single character.‘*’ Matches any sequence of characters ...

2019-12-18 22:19:31 283

原创 【算法】Strong Password Checker 强密码检查

文章目录题目解题思路代码实现题目A password is considered strong if below conditions are all met:It has at least 6 characters and at most 20 characters.It must contain at least one lowercase letter, at least one u...

2019-12-11 21:27:41 683

原创 【算法】Palindrome Partitioning III 回文分区3

题目You are given a string s containing lowercase letters and an integer k. You need to :First, change some characters of s to other lowercase English letters.Then divide s into k non-empty disjoint ...

2019-12-08 21:32:46 158

原创 Swift面试题录(持续更新ing)

Swift面试题录(持续更新ing)文章目录Swift面试题录(持续更新ing)什么是函数编程struct与class 的区别Map、FlatMap、CompactMap、CompactMapValues、Filter、Reduce...

2019-11-30 21:23:44 327

原创 【Swift】Map、FlatMap、CompactMap、CompactMapValues、Filter、Reduce

【Swift】Map、FlatMap、CompactMap、CompactMapValues、Filter、Reduce文章目录【Swift】Map、FlatMap、CompactMap、CompactMapValues、Filter、ReduceMapcompactMapcompactMapValuesflatmapfilterreduceMapmap可以遍历集合并对每个元素进行处理,得到...

2019-11-30 21:17:02 357

原创 【算法】Number of Ways to Stay in the Same Place After Some Steps 有多少种移动一定步数后留在原位置的路径

Number of Ways to Stay in the Same Place After Some Steps 有多少种移动一定步数后留在原位置的路径文章目录Number of Ways to Stay in the Same Place After Some Steps 有多少种移动一定步数后留在原位置的路径题目解题思路代码实现题目ou have a pointer at index ...

2019-11-27 21:21:30 400

原创 【swift】struct与class 的区别

数据类型:struct是值类型,class是引用类型。值类型变量直接包含数据,赋值时也是值拷贝,或者叫深拷贝,所以多个变量的操作不会相互影响。引用类型变量存储的是对数据的引用地址,后者称为对象,赋值时,是将对象的引用地址复制过去,也叫浅拷贝,因此若多个变量指向同一个对象时,操作会相互影响。值类型数据没有引用计数,也就不会因为循环引用导致内存泄漏,而引用类型存在引用计数,需要小心循环引用...

2019-11-25 21:58:24 773

原创 【算法】Word Ladder II单词接龙

文章目录Word Ladder II 寻找字梯题目解题思路代码实现Word Ladder II 寻找字梯题目Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, ...

2019-11-21 23:53:21 147

原创 【算法】Find the Closest Palindrome 寻找最近的较小回数

文章目录Longest Duplicate Substring 最长重复子串题目解题思路代码实现Longest Duplicate Substring 最长重复子串题目Given an integer n, find the closest integer (not including itself), which is a palindrome.The ‘closest’ is defi...

2019-11-12 19:24:01 162 1

原创 【算法】Longest Duplicate Substring 最长重复子串

文章目录Longest Duplicate Substring 最长重复子串题目解题思路代码实现Longest Duplicate Substring 最长重复子串题目给出一个字符串,得出该字符串的最长重复字串,如 “abcabcabc” 的最长重复字串,是 “abcabc”解题思路通过Rabin-Karp算法,可以加速字符串比对简单来说,就是将每个字符映射为一个数值然后设计一个...

2019-11-06 23:24:24 266

原创 【算法】Max Points On A Line 坐标系中一条直线上的最多点数

文章目录Max Points On A Line 坐标系中一条直线上的最多点数题目解题思路代码实现Max Points On A Line 坐标系中一条直线上的最多点数题目给出一组坐标系的点,求出能连成一条直线的最多点数解题思路将坐标点 p1 的 x1 与 y1 的值,依次与后面的坐标点 pn的 xn 与 yn 做差值并相除((x1 - xn) / (y1 - yn))得出两点之间的斜...

2019-10-31 23:15:36 322

原创 【算法】Valid Number 有效数字

文章目录Valid Number 有效数字题目解题思路代码实现Valid Number 有效数字题目给出一个数字的字符串,可以是科学记数,其中 “3. “、 " .3”、”+.8"也算是正确记数“0” => true" 0.1 " => true“abc” => false“1 a” => false“2e10” => true" -90e3 "...

2019-10-24 20:42:37 726

原创 React/React-Native中的{}

文章目录import {user} from "./person"const { urlToPathAndParams } = pathUtilsimport {user} from “./person”在import时,有时会用{}引用,有时就不用{},区别如下://person.jsexport default 'person'export const user = 42expor...

2019-10-21 09:59:04 214

原创 【算法】GCJ2019 Cryptopangrams

这里写自定义目录标题GCJ2019 Cryptopangrams题目:解题思路实现代码GCJ2019 Cryptopangrams题目:出题人随机选了26个不超过N的素数,按照从小到大排列,把每个素数分给起对应的字母,得到了一个由大写字母到这26个素数的一个bijection。然后出题人通过这个bijection对一段message加密,加密过程为(1)把每个字符替换成其对应的素数,得到一...

2019-10-17 22:54:16 187

原创 【算法】元素重复三次的数组中查找重复一次的元素

元素重复三次的数组中查找重复一次的元素文章目录元素重复三次的数组中查找重复一次的元素题目:解题思路实现代码题目:给定一个大数组,它里面除了一个元素外,其他元素都重复了三次,要求在空间复杂度为O(1), **时间复杂度为O(n)**的约束下,查找到只重复了一次的元素。意思就是说:这意味着算法必须对数组遍历1次就要找出给定元素。解题思路参考位图算法,声明两个变量 firstAppear...

2019-10-09 20:19:06 962

原创 xcode11创建新项目时,黑屏了,不显示View

在兴冲冲更新了Xcode11,并创建了项目之后,且发现真机和模拟器都黑屏了,怎么都不显示View了。然后项目中比之前莫名其妙的多出来了两个文件:APPdelegate.m中也多了两段不明所以的代码:#pragma mark - UISceneSession lifecycle- (UISceneConfiguration *)application:(UIApplication *)ap...

2019-10-02 20:08:09 3949

原创 dyld: Library not loaded: @rpath/libswiftCore.dylib ... Reason: image not found 解决

在室友Xcode继承一些framework时,爆出了如下错误:dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /private/var/containers/Bundle/Application/1761A6FE-9D6B-45F7-9F9F-922C94BF54A3/demo.app/Framewor...

2019-10-02 19:11:48 2777

原创 【Xcode】查看真机中APP的数据

开发调试时,时而会去查看真机里面的数据,可以通过下载.xcappdata文件实现:Xcode -> Window -> Devices选择设备,右边 Installed Apps 中,可以找到安装第三方APP。设置/齿轮按钮 -> Download Container… ,生成一个.xcappdata文件下载到Mac上。在.xcappdata文件上右击,选择Show p...

2019-09-26 15:37:00 1146

原创 RN/JS里的相对路径

文章目录RN/JS里的相对路径RN/JS里的相对路径当前路径为d://depth1/depth2/path~images 和 /images -> 根路径d://images./images 和 images -> 当前目录路径dd://depth1/depth2/path/images…/images -> 当前目录的上一级d://depth1/depth2/i...

2019-09-25 15:09:41 454

原创 React-Native 上的疑难杂症(未分类,待补充)

文章目录[React Native]错误: 'config.h' file not found / ":CFBundleIdentifier", Does Not Exist[1]React Native启动报错的问题 getCurrentAppState:error 和 objectAtIndexedSubscript:[React Native]错误: ‘config.h’ file not...

2019-09-24 14:32:23 384

转载 线性的那个表啊

线性表定义:具有相同特性数据元素的有限序列。所含元素的个数 n(n&gt;=0) 叫做线性表的长度。 线性表的逻辑特性:线性表只有一个表头元素和一个表尾元素,表头元素没有前驱,表尾元素没有后继,其余元素只有一个直接前驱和一个直接后继。 线性表的存储结构:顺序存储结构(顺序表)和链式存储结构(链表)。 1. 顺序表:线性表中的所有元素按照逻辑顺序依次存储到从指定的储存位置开始的一块连续的存储...

2018-06-14 15:03:12 153

原创 OC UITableView 的些许问题

OC UITableView 的些许问题OC UITableView 的些许问题解决iOS11tableView:heightForHeaderInSection:方法不执行的问题:解决UITableView顶部和底部留白问题:Assertion failure in [UISectionRowData refreshWithSection:tableView:tableViewRo...

2018-06-14 14:30:00 329

空空如也

空空如也

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

TA关注的人

提示
确定要删除当前文章?
取消 删除