随笔分类 - Arrays & Hashing
摘要:128. Longest Consecutive Sequence Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must w
阅读全文
摘要:271. Encode and Decode Strings 居然要premium才能做,果断换LintCode来写这题 Design an algorithm to encode a list of strings to a string. The encoded string is then s
阅读全文
摘要:238. Product of Array Except Self Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements
阅读全文
摘要:347. Top K Frequent Elements Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order
阅读全文
摘要:49. Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase
阅读全文
摘要:1. Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume th
阅读全文
摘要:242. Valid Anagram Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearr
阅读全文
摘要:217. Contains Duplicate Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element i
阅读全文