上一页 1 2 3 4 5 6 ··· 16 下一页
摘要: 题目: 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 the fol 阅读全文
posted @ 2018-01-15 14:39 荒野第一快递员 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a list, rotate the list to the right by k places, where k is non-negative. Example: 题意及分析:从右到左第n个点进行翻转链表。主要是要找到翻转点和翻转点前面一个点,然后将最后一个点的next设置为 阅读全文
posted @ 2018-01-10 09:20 荒野第一快递员 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 题意及分析:求两个用字符串表示 的二进制数的和。主要是判断每次相加的和是否大 阅读全文
posted @ 2018-01-09 09:02 荒野第一快递员 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题目: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for 阅读全文
posted @ 2018-01-08 19:47 荒野第一快递员 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any le 阅读全文
posted @ 2018-01-08 16:01 荒野第一快递员 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You 阅读全文
posted @ 2018-01-08 14:59 荒野第一快递员 阅读(412) 评论(0) 推荐(0) 编辑
摘要: //1、冒泡排序 public void bubbleSort(int[] arr){ for(int i=0;i arr[j+1]){ int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; ... 阅读全文
posted @ 2018-01-07 15:11 荒野第一快递员 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 题意及分析:给出一个un 阅读全文
posted @ 2017-12-22 11:00 荒野第一快递员 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You h 阅读全文
posted @ 2017-12-22 10:12 荒野第一快递员 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 题目: iven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra 阅读全文
posted @ 2017-12-21 14:37 荒野第一快递员 阅读(180) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 16 下一页