Authentic Preference

Technologies come and technologies go, but insight is forever.

Linux-Ubuntu的三种权限

Ubuntu中的权限共有三类: 个人 组 其他个人 u:如果个人可以访问写入和执行某个文件,就说对这个文件有所有权。 组 g:如果某个人属于这个组,则这个人拥有这个组的权限 其他 o:不属于个人和组权限项: 读取 r 写入 w 执行 x 权限命令: chmod例子: c...

2017-07-31 22:40:38

阅读数:161

评论数:0

80. Remove Duplicates from Sorted Array II

题目可以重复一次的去重操作Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],You...

2017-07-31 17:43:19

阅读数:304

评论数:0

59. Spiral Matrix II

题目生成螺旋矩阵 Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example, Given n = 3,You should return ...

2017-07-30 15:17:56

阅读数:384

评论数:0

54. Spiral Matrix

螺旋式遍历矩阵 如下图所示的方法。 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example, Given the f...

2017-07-30 14:48:27

阅读数:475

评论数:0

linux入门-shell(.sh)脚本编写和运行

编写第一个shell脚本在gedit中编写.sh格式的文件,保存为a.sh。 代码: #! /bin/bash # employ bash shell player1=xiaoming # define a player1 player2=ken echo "Game start...

2017-07-29 21:54:16

阅读数:809

评论数:0

90. Subsets II

题目Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note: The solution set must not contain duplicate s...

2017-07-29 19:20:54

阅读数:2597

评论数:0

78. Subsets

题目Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example, If nums...

2017-07-29 18:38:48

阅读数:2501

评论数:0

60. Permutation Sequence

题目求n个排序数的第k项 The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the fo...

2017-07-29 15:54:48

阅读数:2544

评论数:0

147. Sort a linked list using insertion sort

题目Sort a linked list using insertion sort.代码public ListNode InsertionSortList(ListNode head) { if (head == null) return null; ...

2017-07-27 17:22:02

阅读数:2492

评论数:0

142. Linked List Cycle II

题目Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note: Do not modify the linked list.Follow up: Can ...

2017-07-26 19:15:18

阅读数:345

评论数:0

41. First Missing Positive

Find Missing Number 系列问题,灵活运用index,或异或在O(n)时间复杂度,O(1)空间复杂度解决问题。题目Given an unsorted integer array, find the first missing positive integer.For example...

2017-07-26 11:16:25

阅读数:2395

评论数:0

47. Permutations II

原题求解带有重复元素的序列的所有排序 Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example, [1,1,2] have t...

2017-07-25 17:22:57

阅读数:2423

评论数:0

46. Permutations

求一个序列的所有排序组合。题目Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations:[ [1,...

2017-07-25 14:37:36

阅读数:211

评论数:0

31. Next Permutation

求其下一个排序数的思路: 1. **逆序**搜索,找到第一个满足 $$nums[i-1]<nums[i] $$ 的位置,在 i=1 处。并且 **i~n-1 序列一定是一个逆序序列**; 2. 交换 nums[i-1] 和 i>=1子序列的最小值。 最小值为 **4**;即交换 3 ...

2017-07-25 08:33:31

阅读数:214

评论数:0

64. Minimum Path Sum

题目Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its pat...

2017-07-24 14:53:01

阅读数:298

评论数:0

63. Unique Paths II

上一个题目的完整解题思路: http://blog.csdn.net/daigualu/article/details/76018298Follow up for “Unique Paths”:Now consider if some obstacles are added to the gri...

2017-07-24 12:45:21

阅读数:334

评论数:0

62. Unique Paths

题目A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any...

2017-07-24 12:40:55

阅读数:332

评论数:0

40. Combination Sum II

题目Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each n...

2017-07-22 21:46:03

阅读数:630

评论数:0

39. Combination Sum

题目Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers su...

2017-07-22 19:33:22

阅读数:286

评论数:0

25. Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equa...

2017-07-20 17:14:35

阅读数:372

评论数:1

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