摘要:
1、注释多行 1). 首先按esc进入命令行模式下,按下Ctrl + v,进入VISUAL BLOCK模式; 2). 在行首使用上下键选择需要注释的多行; 3). 按下键盘(大写)“I”键,进入插入模式; 4). 然后输入注释符(“//”、“#”等); 5). 最后按下“Esc”键。 注:在按下es 阅读全文
摘要:
1、安装okular sudo apt-get install okular 2、强大的注释功能(可以对pdf添加note,或者高亮显示文本highlight 按 F6 打开注释功能。 阅读全文
摘要:
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文
摘要:
Given the root of a binary tree, return the sum of every tree node's tilt. The tilt of a tree node is the absolute difference between the sum of all l 阅读全文
摘要:
Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and sum the result 阅读全文
摘要:
描述 property() 函数的作用是在新式类中返回属性值。大概意思就是让方法变成一个属性 语法 以下是 property() 方法的语法: class property([fget[, fset[, fdel[, doc]]]]) 参数 fget -- 获取属性值的函数 fset -- 设置属性 阅读全文
摘要:
描述 classmethod 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等。 语法 classmethod 语法: classmethod 参数 无。 返回值 返回函数的类方法。 实例 以下实例展示了 阅读全文
摘要:
staticmethod()是python内置函数, 该方法不强制要求传递参数,如下声明一个静态方法: class C(object): @staticmethod def f(arg1, arg2, ...): ... 以上实例声明了静态方法 f,从而可以实现实例化使用 C().f(),当然也可以 阅读全文
摘要:
You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, 阅读全文
摘要:
Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
摘要:
Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes 阅读全文
摘要:
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
摘要:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appea 阅读全文
摘要:
Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: Input: -1->5->3->4-> 阅读全文
摘要:
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文
摘要:
Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0. You may assume 阅读全文
摘要:
问题背景 最近在忙gitlab服务器及自动化编译jenkins平台的搭建,其中也配置了邮箱提醒服务,成功之后让IT部门给我固定服务器ip,然后便出现了一系列的问题(其他公司内部主机经常访问不上gitlab服务器,经常断开。gitlab无法触发Jenkins。特别是无法触发jenkins这个问题,一直 阅读全文
摘要:
Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB Description 小Hi家的阳台上摆着一排N个空花盆,编号1~N。从第一天开始,小Hi每天会选择其中一个还空着花盆,栽种一株月季花,直到N个花盆都栽种满月季。 我们知道小H 阅读全文
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
摘要:
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
摘要:
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
摘要:
Given a binary tree, return the sum of values of nodes with even-valued grandparent. (A grandparent of a node is the parent of its parent, if it exist 阅读全文
摘要:
Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, yo 阅读全文
摘要:
Given a m * n matrix mat and an integer K, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for i - K <= r <= i + K 阅读全文
摘要:
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh 阅读全文
摘要:
There are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th p 阅读全文
摘要:
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0 阅读全文
摘要:
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
摘要:
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 阅读全文
摘要:
You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: direction can be 0 (for left 阅读全文
摘要:
Given the array nums, obtain a subsequence of the array whose sum of elements is strictly greater than the sum of the non included elements in such su 阅读全文
摘要:
Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the num 阅读全文
摘要:
A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), followed by some number of '1's (also possibly 0. 阅读全文
摘要:
Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest rows in the matrix or 阅读全文
摘要:
Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwis 阅读全文
摘要:
Given an array nums of n integers, are there elements a, b, c in numssuch that a + b + c = 0? Find all unique triplets in the array which gives the su 阅读全文
摘要:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Input: 1->2 阅读全文
摘要:
Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation).Flip o 阅读全文
摘要:
Given an integer n. No-Zero integer is a positive integer which doesn't contain any 0 in its decimal representation. Return a list of two integers [A, 阅读全文
摘要:
You have a set of tiles, where each tile has one letter tiles[i]printed on it. Return the number of possible non-empty sequences of letters you can ma 阅读全文
摘要:
Design an Iterator class, which has: A constructor that takes a string characters of sorted distinctlowercase English letters and a number combination 阅读全文