代码改变世界

[LeetCode] 252. Meeting Rooms_Easy tag: Sort

2018-08-16 10:11 by Johnson_强生仔仔, 206 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all mee 阅读全文

[LeetCode] 232. Implement Queue using Stacks_Easy tag: Design

2018-08-16 09:49 by Johnson_强生仔仔, 238 阅读, 0 推荐, 收藏, 编辑
摘要:Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文

[LeetCode] 724. Find Pivot Index_Easy tag: Dynamic Programming

2018-08-16 00:49 by Johnson_强生仔仔, 201 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文

[LeetCode] 364. Nested List Weight Sum II_Medium tag:DFS

2018-08-16 00:21 by Johnson_强生仔仔, 270 阅读, 0 推荐, 收藏, 编辑
摘要:Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文

[LeetCode] 339. Nested List Weight Sum_Easy tag:DFS

2018-08-15 23:50 by Johnson_强生仔仔, 280 阅读, 0 推荐, 收藏, 编辑
摘要:Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文

[LeetCode] 628. Maximum Product of Three Numbers_Easy

2018-08-15 12:22 by Johnson_强生仔仔, 184 阅读, 0 推荐, 收藏, 编辑
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp 阅读全文

[LeetCode] 438. Find All Anagrams in a String_Easy

2018-08-15 11:14 by Johnson_强生仔仔, 142 阅读, 0 推荐, 收藏, 编辑
摘要:438. Find All Anagrams in a String 438. Find All Anagrams in a String 438. Find All Anagrams in a String 438. Find All Anagrams in a String Descriptio 阅读全文

[LeetCode] 804. Unique Morse Code Words_Easy tag: Hash Table

2018-08-15 05:10 by Johnson_强生仔仔, 155 阅读, 0 推荐, 收藏, 编辑
摘要:International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a"maps to ".-", "b" maps 阅读全文

[LeetCode] 717. 1-bit and 2-bit Characters_Easy

2018-08-15 04:56 by Johnson_强生仔仔, 182 阅读, 0 推荐, 收藏, 编辑
摘要:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文

[LeetCode] 383. Ransom Note_Easy tag: Hash Table

2018-08-15 00:45 by Johnson_强生仔仔, 158 阅读, 0 推荐, 收藏, 编辑
摘要:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 39 下一页