摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2017-03-16 23:39 MiaBlog 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than  阅读全文
posted @ 2017-01-13 23:52 MiaBlog 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2017-01-13 03:41 MiaBlog 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Example:Given binary tree Returns [4, 5, 3], [2], [1]. Explanation: 1. Removing the leaves [4, 5, 3] would result in this tree: 2. Now removing the le 阅读全文
posted @ 2017-01-13 00:43 MiaBlog 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2016-12-21 05:37 MiaBlog 阅读(500) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n  阅读全文
posted @ 2016-12-15 04:57 MiaBlog 阅读(388) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-12-14 00:40 MiaBlog 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Leetcode C#, Hash Map, Two pointers 阅读全文
posted @ 2016-12-03 01:17 MiaBlog 阅读(628) 评论(0) 推荐(0) 编辑
摘要: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For 阅读全文
posted @ 2016-12-01 06:47 MiaBlog 阅读(455) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文
posted @ 2016-11-24 03:36 MiaBlog 阅读(125) 评论(0) 推荐(0) 编辑