golang
liff_lee
一个拼死拼活想学计算机编程掉了很多头发的文艺菜鸟
展开
-
【leetcode每日刷题】160. Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:begin to intersect at node c1.使用两个指针package mainty...原创 2019-11-16 17:49:09 · 82 阅读 · 0 评论 -
【leetcode每日刷题】454. 4Sum II
Given four lists A, B, C, D of integer values, compute how many tuples(i, j, k, l)there are such thatA[i] + B[j] + C[k] + D[l]is zero.To make problem a bit easier, all A, B, C, D have same lengt...原创 2019-07-14 12:22:06 · 101 阅读 · 0 评论 -
【leetcode每日刷题】17. Letter Combinations of a Phone Number
Given a string containing digits from2-9inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is giv...原创 2019-04-02 15:44:03 · 130 阅读 · 0 评论 -
【leetcode每日刷题】56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10],[15,18]]Explanation: Since intervals [1,3] and [2,6] overlaps...原创 2019-03-28 17:15:06 · 139 阅读 · 0 评论 -
【leetcode每日刷题】394. Decode String
Given an encoded string, return it's decoded string.The encoding rule is:k[encoded_string], where theencoded_stringinside the square brackets is being repeated exactlyktimes. Note thatkis gua...原创 2019-03-27 21:18:57 · 218 阅读 · 0 评论 -
【leetcoed每日刷题】13. Roman to Integer
Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-04-01 12:36:50 · 118 阅读 · 0 评论 -
【leetcode每日刷题】12. Integer to Roman
Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-04-01 12:03:48 · 119 阅读 · 0 评论 -
【leetcode每日刷题】8. String to Integer (atoi)
Implementatoiwhichconverts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...原创 2019-03-30 12:07:47 · 129 阅读 · 0 评论 -
【leetcode每日刷题】50. Pow(x, n)
Implementpow(x,n), which calculatesxraised to the powern(xn).Example 1:Input: 2.00000, 10Output: 1024.00000Example 2:Input: 2.10000, 3Output: 9.26100Example 3:Input: 2.00000, ...原创 2019-03-26 12:35:44 · 101 阅读 · 0 评论 -
【leetcode每日刷题】67. Add Binary
Given two binary strings, return their sum (also a binary string).The input strings are bothnon-emptyand contains only characters1or0.Example 1:Input: a = "11", b = "1"Output: "100"Exam...原创 2019-03-25 15:23:11 · 198 阅读 · 0 评论 -
【leetcode每日刷题】18. 4Sum
Given an arraynumsofnintegers and an integertarget, are there elementsa,b,c, anddinnumssuch thata+b+c+d=target? Find all unique quadruplets in the array which gives the sum oftar...原创 2019-03-21 16:45:21 · 171 阅读 · 0 评论 -
【leetcode刷题】4. Median of Two Sorted Arrays
There are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assumenums1andn...原创 2019-03-12 21:51:16 · 67 阅读 · 0 评论 -
【leetcode刷题】19. Remove Nth Node From End of List
Given a linked list, remove then-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, t...原创 2019-03-20 22:31:40 · 159 阅读 · 0 评论 -
【leetcode刷题】9. Palindrome Number
Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExpl...原创 2019-03-14 15:32:44 · 89 阅读 · 0 评论 -
【leetcode刷题】7. 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: 21Note:Assume we are dea...原创 2019-03-13 21:40:59 · 118 阅读 · 0 评论 -
go 运行错误expected 'package', found 'EOF'解决
只要将文件保存一下,再运行就ok了。原创 2018-10-16 22:01:11 · 39730 阅读 · 19 评论