Leetcode
Bt4Girls
Learning for the dream
展开
-
Leetcode_cn-两数相加[JAVA]
解答过程 /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNode addTw...原创 2018-05-29 11:51:26 · 396 阅读 · 0 评论 -
Leetcode_cn-旋转图像,时间复杂度O(2N^2)[JAVA]
旋转图像 public static void rotate(int[][] matrix) { int len=matrix.length; int temp[][]=new int[matrix.length][matrix.length]; for(int j=0;j<len;j++) { int q=0; ...原创 2018-05-29 13:45:20 · 297 阅读 · 0 评论 -
Leetcode_cn-118. 杨辉三角[JAVA]
题目链接 class Solution { public List<List<Integer>> generate(int numRows) { List<List<Integer>> column = new ArrayList<>(); for(int i=0;i<numRows;i...原创 2018-05-30 19:16:34 · 250 阅读 · 0 评论 -
Leetcode_cn-796. 旋转字符串[JAVA]
原题地址 public boolean rotateString(String A, String B) { if(A.equals(B)) return true; char []a=A.toCharArray(); char []b=B.toCharArray(); int len=b.length;...原创 2018-05-31 09:01:09 · 568 阅读 · 1 评论