码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
7.Reverse Integer (INT; Overflow)
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321思路:要注意溢出。用以下做法,会溢出。class Solution {public: int reverse(in...
分类:其他好文   时间:2015-07-15 16:40:17    阅读次数:83
leetCode 59.Spiral Matrix II (螺旋矩阵II) 解题思路和方法
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 following matrix: [  [ 1, 2, 3 ],  [ 8, 9, 4 ]...
分类:其他好文   时间:2015-07-15 15:08:07    阅读次数:253
072 Edit Distance
072 Edit Distance纯dp 解法, 唯一可以优化的就是空间复杂度了,以下代码没有优化。。。class Solution: # @param {string} word1 # @param {string} word2 # @return {integer} de...
分类:其他好文   时间:2015-07-15 14:58:13    阅读次数:81
php基础教程-数据类型
PHP 支持八种原始类型(type)。四种标量类型:string(字符串)integer(整型)float(浮点型,也作 double )boolean(布尔型)两种复合类型:array(数组)object(对象)两种特殊类型:resource(资源)NULL(空)如何查看变量类型通过 gettyp...
分类:Web程序   时间:2015-07-15 14:48:09    阅读次数:145
javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer
[java] view plaincopyprint? Apr 8, 2014 2:13:57 PM org.apache.catalina.core.StandardWrapperValve invoke   SEVERE: Servlet.service() for servlet springmvc threw exception   javax.valid...
分类:编程语言   时间:2015-07-15 13:16:30    阅读次数:230
[LeetCode][Java] N-Queens
题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-...
分类:编程语言   时间:2015-07-15 11:12:55    阅读次数:117
文章标题
链接:https://leetcode.com/problems/minimum-size-subarray-sum/ 问题描述: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there...
分类:其他好文   时间:2015-07-15 09:34:47    阅读次数:116
88 Merge Sorted Array
88 Merge Sorted Array链接:https://leetcode.com/problems/merge-sorted-array/ 问题描述: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that...
分类:其他好文   时间:2015-07-15 09:34:01    阅读次数:89
Majority Element in an Array
Problem StatementGiven a large array of non-negative integer numbers, write a function which determines whether or not there is a number that appears ...
分类:其他好文   时间:2015-07-15 01:13:26    阅读次数:333
leetcode Roman to integer
题目: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.要把罗马数字转换为整数, 罗马数字自行百度code:class Solution { public: int romanToInt(string s) {...
分类:其他好文   时间:2015-07-14 23:58:07    阅读次数:401
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!