
LeetCode
j-mac
这个作者很懒,什么都没留下…
展开
-
83. Remove Duplicates from Sorted List
记录一下删除重复单链表接点:/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */struct ListNode* deleteDuplicates(struct ListNode* head) { s...原创 2018-08-23 15:09:58 · 139 阅读 · 0 评论 -
LeetCode728. Self Dividing Numbers
class Solution: def selfDividingNumbers(self, left, right): """ :type left: int :type right: int :rtype: List[int] """ ans = [] for i in ra...原创 2018-01-20 16:13:49 · 199 阅读 · 0 评论 -
169. Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element alwa...原创 2018-11-18 21:53:26 · 144 阅读 · 0 评论