
【LeetCode】
小烽努力变强
自己选择的路跪着也要走完!
展开
-
【LeetCode1】Reverse Linked List
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */class Solution { public ListNode reve...原创 2019-03-31 11:41:02 · 111 阅读 · 0 评论 -
【LeetCode】1. Two Sum
原题网址:https://leetcode.com/problems/two-sum/解题思路:我的解:毫无疑问的暴力解。。。。这次暴力解出现问题了。。。就是[3,3] 6的时候我的解法会出现问题public static int[] twoSum(int[] nums, int target) { int l = nums.length; i...原创 2019-04-11 00:43:47 · 138 阅读 · 0 评论 -
【LeetCode】977. Squares of a Sorted Array
原题网址:https://leetcode.com/problems/squares-of-a-sorted-array/解题思路:我的解:毫无疑问的暴力解。。。。 public int[] sortedSquares(int[] A) { int len = A.length; int[] B = new int[len]; f...原创 2019-04-09 00:43:11 · 152 阅读 · 0 评论 -
【LeetCode】 35. Search Insert Position
原题网址:https://leetcode.com/problems/two-sum/解题思路:这题思路和插入排序非常相似,我就是根据插入排序思想写的,代码比较简单public static int searchInsert(int[] nums, int target) {// int len = nums.length; int i; ...原创 2019-04-27 16:04:31 · 184 阅读 · 0 评论