12 2020 档案
摘要:package LeetCode_981 import java.util.* import kotlin.collections.HashMap /** * 981. Time Based Key-Value Store * https://leetcode.com/problems/time-b
阅读全文
摘要:package LeetCode_1146 /** * 1146. Snapshot Array * https://leetcode.com/problems/snapshot-array/ * Implement a SnapshotArray that supports the followi
阅读全文
摘要:package LeetCode_565 /** * 565. Array Nesting * https://leetcode.com/problems/array-nesting/ * A zero-indexed array A of length N contains all integer
阅读全文
摘要:package LeetCode_79 /** * 79. Word Search * https://leetcode.com/problems/word-search/ * Given an m x n board and a word, find if the word exists in t
阅读全文
摘要:package LeetCode_43 /** * 43. Multiply Strings * https://leetcode.com/problems/multiply-strings/ * Given two non-negative integers num1 and num2 repre
阅读全文
摘要:package _interview_question /** * You are given a list of non-negative integers. * Find the largest value of the expression you can get by using +, *
阅读全文
摘要:package LeetCode_1014 /** * 1014. Best Sightseeing Pair * https://leetcode.com/problems/best-sightseeing-pair/ * Given an array A of positive integers
阅读全文
摘要:package LeetCode_562 /** * 562. Longest Line of Consecutive One in Matrix * (Prime) *Given a 01 matrix M, find the longest line of consecutive one in
阅读全文
摘要:package LeetCode_561 /** * 561. Array Partition I * https://leetcode.com/problems/array-partition-i/ * Given an integer array nums of 2n integers, gro
阅读全文
摘要:hashCode()和equals()是什么? hashCode()方法和equals()方法的作用其实是一样,在java里都是用来对比两个对象是否相等一致。 hashCode()和equals()的区别 我们从两个角度介绍他们的区别:1. 性能,2. 可靠性,他们之间的主要区别也基本体现在这里。
阅读全文
摘要:package LeetCode_1496 /** * 1496. Path Crossing * https://leetcode.com/problems/path-crossing/ * Given a string path, where path[i] = 'N', 'S', 'E' or
阅读全文
摘要:package LeetCode_1678 /** * 1678. Goal Parser Interpretation * https://leetcode.com/problems/goal-parser-interpretation/ * You own a Goal Parser that
阅读全文
摘要:package LeetCode_1694 import java.util.* /** * 1694. Reformat Phone Number * https://leetcode.com/problems/reformat-phone-number/ * You are given a ph
阅读全文
摘要:package _interview_question /** * Given a integer n, return all amicable paris * */ class Solution16 { /* * solution: get sum of divisors of number,Ti
阅读全文
摘要:package LeetCode_454 /** * 454. 4Sum II * https://leetcode.com/problems/4sum-ii/ * Given four lists A, B, C, D of integer values, * compute how many t
阅读全文
摘要:package LeetCode_18 /** * 18. 4Sum * https://leetcode.com/problems/4sum/ * Given an array nums of n integers and an integer target, * are there elemen
阅读全文
摘要:package LeetCode_289 /** * 289. Game of Life * https://leetcode.com/problems/game-of-life/ * According to the Wikipedia's article: * "The Game of Life
阅读全文
摘要:package LeetCode_169 /** * 169. Majority Element * https://leetcode.com/problems/majority-element/ * Given an array of size n, find the majority eleme
阅读全文
摘要:package LeetCode_169 /** * 169. Majority Element * https://leetcode.com/problems/majority-element/ * Given an array of size n, find the majority eleme
阅读全文
摘要:package LeetCode_219 /** * 219. Contains Duplicate II * https://leetcode.com/problems/contains-duplicate-ii/ * Given an array of integers and an integ
阅读全文
摘要:package LeetCode_217 /** * 217. Contains Duplicate * https://leetcode.com/problems/contains-duplicate/ * Given an array of integers, find if the array
阅读全文
摘要:ppi pixel per inch,每英寸像素数,针对显示器的设计时,dpi=ppi。ppi计算方法是长宽各自平方之和开方,除以对角线长度(单位英寸)。 dpi dot per inch,每英寸多少点,是由ppi确定的。实际上dpi有: low:120 medium:160 hdpi:240 xh
阅读全文
摘要:对象锁 在代码中的方法上加了synchronized的锁,或者synchronized(this)的代码段。 Java的所有对象都含有一个互斥锁,这个锁由jvm自动获取和释放。线程进入synchronized方法的时候获取该对象的锁,但如果已经有线程获取了这个对象的锁,那么当前线程会等待;synch
阅读全文
摘要:package LeetCode_120 /** * 120. Triangle * https://leetcode.com/problems/triangle/ * Given a triangle, find the minimum path sum from top to bottom. *
阅读全文
摘要:package LeetCode_1689 /** * 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers * https://leetcode.com/problems/partitioning-into-minimum-nu
阅读全文
摘要:package LeetCode_1688 /** * 1688. Count of Matches in Tournament https://leetcode.com/problems/count-of-matches-in-tournament/ You are given an intege
阅读全文
摘要:Zygote:用于孵化进程,system_server创建进程是通过socket向Zygote进程发起请求; installd:用于安装App的守护进程,上层的PackageManagerService很多实最终都是交给它来完成; lmkd:lowmemorykiller的守护进程,Java层Low
阅读全文
摘要:Android系统启动过程是由Boot Loader引导开机,然后依次进入 -> Kernel -> Native -> Framework -> App,接下来简要说说每个过程: Loader层 Boot ROM:当手机处于关机状态时,长按Power键开机,引导心片开始从固化在ROM里的预设代码开
阅读全文
摘要:解决方案见官方文档: https://developer.android.google.cn/about/versions/pie/android-9.0-changes-28 Apache HTTP 客户端弃用 在 Android 6.0 中,我们取消了对 Apache HTTP 客户端的支持。
阅读全文
摘要:package LeetCode_1668 /** * 1668. Maximum Repeating Substring * https://leetcode.com/problems/maximum-repeating-substring/ * For a string sequence, a
阅读全文
摘要:package LeetCode_1673 import java.util.* /** * 1673. Find the Most Competitive Subsequence * https://leetcode.com/problems/find-the-most-competitive-s
阅读全文
摘要:package LeetCode_1032 /** * 1032. Stream of Characters * https://leetcode.com/problems/stream-of-characters/ * Implement the StreamChecker class as fo
阅读全文
摘要:package LeetCode_824 /** * 824. Goat Latin * https://leetcode.com/problems/goat-latin/ * A sentence S is given, composed of words separated by spaces.
阅读全文
摘要:package LeetCode_784 /** * 784. Letter Case Permutation * https://leetcode.com/problems/letter-case-permutation/ * Given a string S, we can transform
阅读全文
摘要:package LeetCode_778 import java.util.* /** * 778. Swim in Rising Water * https://leetcode.com/problems/swim-in-rising-water/ * On an N x N grid, each
阅读全文
摘要:package LeetCode_456 import java.util.* /** * 456. 132 Pattern * https://leetcode.com/problems/132-pattern/ * Given an array of n integers nums, * a 1
阅读全文
摘要:package LeetCode_764 /** * 764. Largest Plus Sign * https://leetcode.com/problems/largest-plus-sign/ * * In a 2D grid from (0, 0) to (N-1, N-1), every
阅读全文
摘要:package LeetCode_771 /** * 771. Jewels and Stones * https://leetcode.com/problems/jewels-and-stones/ * You're given strings J representing the types o
阅读全文