ARTS #67 | 很酷的灯光效果 Algorithm 本周选择的算法题是:Jump Game II 规则如下: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum j...
ARTS #66 | pdb Algorithm 本周选择的算法题是:Remove Invalid Parentheses 规则如下: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input strin...
ARTS #65 | 编程很复杂 Algorithm 本周选择的算法题是:Sum of Square Numbers 规则如下: Given a non-negative integer c, your task is to decide whether there’re two integers a and b such that a2 + b2 = c. Example 1: Input: 5 Output: ...
Swift: weak 的 strong 时机 前言 早前在Swift 内存管理中整理过一张思维导图,当时主要是通过官方资料和前人的经验得出的结论,不过内心里有2个疑问一直没有得到答案: Swift 的 weak 变量会在使用前尝试 +1 strong,但是具体的时机是什么时候呢? Objective-C 中的 Weak-Strong Dance 在 Swift 中是否还需要? 今天就通过...
ARTS #64 | 善战者无赫赫之功 Algorithm 本周选择的算法题是:Rearrange Words in a Sentence 规则如下: Given a sentence text (A sentence is a string of space-separated words) in the following format: First letter is in upper case. Each...
更新 CodingTour 最近对个人网站做了一次更新,主要做了这么几件事: 优化 CSS: 支持 Dark Mode 新的 Logo 优化 CSS 现在的这套 CSS 代码自去年建站以来就没怎么动过,文件既没有压缩,还充斥着各种尝试、注释和临时的解决方案。这次想通过对一些工具的使用来指导自己改善代码,我选择了两个工具: Chrome Lighthouse - 对网站生成性能、SEO 等报...
ARTS #63 | 早就是优势 Algorithm 本周选择的算法题是:Count of Smaller Numbers After Self 规则如下: You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is ...
ARTS #62 | 不要只顾低头赶路 Algorithm 本周选择的算法题是:Implement Queue using Stacks 规则如下: Implement the following operations of a queue using stacks. push(x) – Push element x to the back of queue. pop() – Removes the elemen...
ARTS #61 | 性能优化就是从限制到极致 Algorithm 本周选择的算法题是:Kth Largest Element in an Array 规则如下: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct ele...
如何系统性的做好高性能优化 “如果你无法衡量它,那么也无法改善它。“ – Lord Kelvin 性能优化就是在各种限制条件下达到极致的过程。 性能测试是优化的前提和基础,也是性能优化结果的检查和度量标准。 性能测试的第一步,先定义性能指标,从客观性能的角度来看,性能指标包括: 响应时间 客户端程序最直观的体现就是卡不卡 服务端程序最直观的体现就是从发出请求到收...