LeetCode
爆发的~小宇宙
github地址:https://github.com/ordinary-zhang?tab=repositories
展开
-
LeetCode专题:242. Valid Anagram
242. Valid Anagram 题目 Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example 2: Input: s = "rat", t ..原创 2018-08-14 21:56:11 · 211 阅读 · 0 评论 -
LeetCode专题:268. Missing Number
Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5...原创 2018-08-14 22:28:32 · 142 阅读 · 0 评论 -
LeetCode专题:136.Single Number
Single Number Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implemen...原创 2018-08-14 22:55:10 · 190 阅读 · 0 评论 -
LeetCode专题:88. Merge Sorted Array
88. Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and nums2 are m and n respectiv...原创 2018-08-16 21:59:02 · 196 阅读 · 0 评论 -
LeetCode专题:231. Power of Two
Power of Two Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Exam...原创 2018-08-16 22:18:41 · 169 阅读 · 0 评论 -
LeetCode专题:53. Maximum Subarray
Maximum Subarra Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,4,-1,2,1,-5,4], Ou...原创 2018-08-22 00:42:05 · 250 阅读 · 0 评论