上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

2019年3月18日

83. Remove Duplicates from Sorted List(从有序链表中删除重复节点)

摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: 方法二:直接前向传播 递归是从后往 前找,这个用while循环从前从后找。 阅读全文

posted @ 2019-03-18 22:55 shaer 阅读(108) 评论(0) 推荐(0) 编辑

160. Intersection of Two Linked Lists(找出两个链表的交点) &&两个链表的第一个公共结点(剑指offer)

摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文

posted @ 2019-03-18 12:16 shaer 阅读(99) 评论(0) 推荐(0) 编辑

279. Perfect Squares(完美平方数)

摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Example 2: 时间复杂 阅读全文

posted @ 2019-03-18 11:52 shaer 阅读(637) 评论(0) 推荐(0) 编辑

2019年3月13日

关于java中BigDecimal类

摘要: Java在java.math包中提供的API类BigDecimal,用来对超过16位有效位的数进行精确的运算。双精度浮点型变量double可以处理16位有效数。在实际应用中,需要对更大或者更小的数进行运算和处理。float和double只能用来做科学计算或者是工程计算,在商业计算中要用java.ma 阅读全文

posted @ 2019-03-13 21:24 shaer 阅读(90) 评论(0) 推荐(0) 编辑

343. Integer Break (分割整数的最大乘积)

摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文

posted @ 2019-03-13 17:25 shaer 阅读(245) 评论(0) 推荐(0) 编辑

413. Arithmetic Slices(数组中等差递增子区间的个数)

摘要: A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文

posted @ 2019-03-13 16:19 shaer 阅读(145) 评论(0) 推荐(0) 编辑

2019年3月12日

303. Range Sum Query - Immutable(数组区间和)

摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 求区间 i ~ j 的和,可以转换为 sum[j + 1] - s 阅读全文

posted @ 2019-03-12 23:46 shaer 阅读(99) 评论(0) 推荐(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 p 阅读全文

posted @ 2019-03-12 23:22 shaer 阅读(240) 评论(0) 推荐(0) 编辑

61. Rotate List(旋转表)

摘要: Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Example 2: 阅读全文

posted @ 2019-03-12 22:00 shaer 阅读(124) 评论(0) 推荐(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 path. 阅读全文

posted @ 2019-03-12 21:27 shaer 阅读(123) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

导航