上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 67 下一页

2018年3月31日

012 Integer to Roman 整数转换成罗马数字

摘要: 给定一个整数,将其转为罗马数字。输入保证在 1 到 3999 之间。 详见:https://leetcode.com/problems/integer-to-roman/description/ class Solution { public: string intToRoman(int num) 阅读全文

posted @ 2018-03-31 17:54 lina2014 阅读(138) 评论(0) 推荐(0) 编辑

011 Container With Most Water 盛最多水的容器

摘要: 给定 n 个非负整数 a1,a2,…,an,每个数代表坐标中的一个点 (i, ai) 。画 n 条垂直线,使得垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0)。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 详见:https://leetcode.com/prob 阅读全文

posted @ 2018-03-31 17:32 lina2014 阅读(256) 评论(0) 推荐(0) 编辑

010 Regular Expression Matching 正则表达式匹配

摘要: Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element. 阅读全文

posted @ 2018-03-31 16:36 lina2014 阅读(80) 评论(0) 推荐(0) 编辑

007 Reverse Integer 旋转整数

摘要: Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output 阅读全文

posted @ 2018-03-31 14:33 lina2014 阅读(104) 评论(0) 推荐(0) 编辑

006 ZigZag Conversion

摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文

posted @ 2018-03-31 13:50 lina2014 阅读(132) 评论(0) 推荐(0) 编辑

005 Longest Palindromic Substring 最长回文子串

摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab" 阅读全文

posted @ 2018-03-31 11:54 lina2014 阅读(130) 评论(0) 推荐(0) 编辑

003 Longest Substring Without Repeating Characters 最长不重复子串

摘要: Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length 阅读全文

posted @ 2018-03-31 11:52 lina2014 阅读(139) 评论(0) 推荐(0) 编辑

002 Add Two Numbers 链表上的两数相加

摘要: 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 阅读全文

posted @ 2018-03-31 11:50 lina2014 阅读(149) 评论(0) 推荐(0) 编辑

2018年3月30日

洗牌算法

摘要: 洗牌可以抽象为:给定一组排列,输出该排列的一个随机组合 算法一: 实现语言:Java 阅读全文

posted @ 2018-03-30 22:44 lina2014 阅读(139) 评论(0) 推荐(0) 编辑

完美洗牌算法

摘要: 有一个长度为2n的数组{a1,a2,a3,...,an,b1,b2,b3,...,bn},希望排序后变成{a1,b1,a2,b2,a3,b3,...,an,bn},请考虑有没有时间复杂度为O(n)而空间复杂度为O(1)的解法。 阅读全文

posted @ 2018-03-30 22:10 lina2014 阅读(134) 评论(0) 推荐(0) 编辑

上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 67 下一页

导航