摘要:
题目: 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 阅读全文
摘要:
题目: Given a list, rotate the list to the right by k places, where k is non-negative. Example: 题意及分析:从右到左第n个点进行翻转链表。主要是要找到翻转点和翻转点前面一个点,然后将最后一个点的next设置为 阅读全文
摘要:
题目: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 题意及分析:求两个用字符串表示 的二进制数的和。主要是判断每次相加的和是否大 阅读全文
摘要:
题目: 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 阅读全文
摘要:
题目: 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 阅读全文
摘要:
题目: 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 阅读全文
摘要:
//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; ... 阅读全文
摘要:
题目: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 题意及分析:给出一个un 阅读全文
摘要:
题目: 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 阅读全文
摘要:
题目: 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 阅读全文