Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t ...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai ...
分类:
其他好文 时间:
2018-01-13 00:18:36
阅读次数:
112
题目: Given a list, rotate the list to the right by k places, where k is non-negative. Example: 题意及分析:从右到左第n个点进行翻转链表。主要是要找到翻转点和翻转点前面一个点,然后将最后一个点的next设置为 ...
分类:
编程语言 时间:
2018-01-10 11:24:01
阅读次数:
127
Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example 1: Example 2: 时间复杂度:O(logn) ...
分类:
其他好文 时间:
2018-01-04 16:28:49
阅读次数:
189
PAT 1005. Spell It Right (20) Given a non negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the su ...
分类:
其他好文 时间:
2018-01-04 00:25:00
阅读次数:
156
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t ...
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. ...
分类:
其他好文 时间:
2017-12-31 10:49:04
阅读次数:
172
LeeCode是一个有意思的编程网站,主要考察程序员的算法 第二题: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse o ...
分类:
其他好文 时间:
2017-12-30 22:40:29
阅读次数:
207
A. Rounding Vasya has a non-negative integer n. He wants to round it to nearest integer, which ends up with 0. If n already ends up with 0, Vasya cons ...
分类:
其他好文 时间:
2017-12-30 21:26:53
阅读次数:
197
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2017-12-27 14:09:50
阅读次数:
140