LeetCode
文章平均质量分 60
多肉的siri
这个作者很懒,什么都没留下…
展开
-
Reverse Integer
问题Reverse digits of an integer.测试用例Example1: x = 123, return 321Example2: x = -123, return -321我的代码func reverse(x int) int { var y int y = 0 if x > -10原创 2017-09-03 19:43:33 · 184 阅读 · 0 评论 -
Palindrome Number
问题Determine whether an integer is a palindrome. Do this without extra space.测试用例无我的代码func isPalindrome(x int) bool { var revertedx int revertedx = 0 if x < 0{ retu原创 2017-09-03 20:20:25 · 218 阅读 · 0 评论 -
Longest Substring Without Repeating Characters(Time Limit Exceeded)
问题Given a string, find the length of the longest substring without repeating characters.测试用例Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the原创 2017-09-03 17:23:51 · 237 阅读 · 0 评论 -
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 would have exactly one solution, and you may not use原创 2017-09-02 11:08:48 · 224 阅读 · 0 评论 -
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 contain a single digit. Add the two numbers and原创 2017-09-02 11:16:00 · 184 阅读 · 0 评论