随笔分类 -  LeetCode

摘要:Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 思路分析: 1、熟悉罗马数字的规则。见LeetCode之Easy篇 ——(12)In 阅读全文
posted @ 2018-03-23 21:11 丶岑夫子 阅读(164) 评论(0) 推荐(0)
摘要:Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 罗马数字: I V X L C D M 1 5 10 50 100 500 1000 阅读全文
posted @ 2018-03-18 23:15 丶岑夫子 阅读(112) 评论(0) 推荐(0)
摘要:Determine whether an integer is a palindrome. Do this without extra space. 思路一:颠倒整数,再比较。 思路二:翻转后半部分,与前半部分比较。 阅读全文
posted @ 2018-03-17 19:07 丶岑夫子 阅读(146) 评论(0) 推荐(0)
摘要:7、Reverse Integer Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an env 阅读全文
posted @ 2018-03-16 23:21 丶岑夫子 阅读(167) 评论(0) 推荐(0)
摘要:1、Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wou 阅读全文
posted @ 2018-03-15 22:25 丶岑夫子 阅读(136) 评论(0) 推荐(0)