随笔分类 -  a) Leetcode

摘要:最近遇到的几个有意思问题,记录分享一下。 1. 合并三个有序数组(合并K个有序数组) 假如有这么三个数组:(arr包含的三个数组) 问题:K个数组,总共N个元素,合并成一个有序数组。(以升序为例) 大家一眼看上去肯定会想到归并排序,合并两个有序数组是归并排序的最后一步的动作,通过两个指针引导比较大小 阅读全文
posted @ 2020-05-24 19:43 Lawliet__zmz 阅读(383) 评论(2) 推荐(0) 编辑
摘要:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2018-06-04 11:12 Lawliet__zmz 阅读(153) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2018-06-04 11:12 Lawliet__zmz 阅读(83) 评论(0) 推荐(0) 编辑
摘要:简单题,判断好每种情况,(原来剑指offer这个oj需要把js的函数写在给的solution函数里才能AC啊) 传说中的毒瘤题,曾经的一个大佬去google面试时现场没写出来,被google说滚蛋。。。 其实很简单,老样子树结构判断好null 之前就遇到别人讨论过这题,今天碰到这题也格外的亲切,一种 阅读全文
posted @ 2018-05-29 17:52 Lawliet__zmz 阅读(171) 评论(0) 推荐(0) 编辑
摘要:Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: Note: All inputs will be i 阅读全文
posted @ 2017-11-04 00:19 Lawliet__zmz 阅读(167) 评论(0) 推荐(0) 编辑
摘要:14. Longest Common Prefix 14. Longest Common Prefix 14. Longest Common Prefix 14. Longest Common Prefix DescriptionHintsSubmissionsDiscussSolution Des 阅读全文
posted @ 2017-10-27 19:55 Lawliet__zmz 阅读(246) 评论(0) 推荐(0) 编辑
摘要:题目: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", th 阅读全文
posted @ 2017-10-05 22:01 Lawliet__zmz 阅读(535) 评论(0) 推荐(1) 编辑
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2017-08-16 18:30 Lawliet__zmz 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文
posted @ 2017-08-14 16:56 Lawliet__zmz 阅读(111) 评论(0) 推荐(0) 编辑
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-08-14 10:17 Lawliet__zmz 阅读(114) 评论(0) 推荐(0) 编辑
摘要:6. ZigZag Conversion 6. ZigZag Conversion 6. ZigZag Conversion 6. ZigZag Conversion DescriptionHintsSubmissionsDiscussSolution DescriptionHintsSubmiss 阅读全文
posted @ 2017-08-11 18:14 Lawliet__zmz 阅读(189) 评论(0) 推荐(0) 编辑
摘要:5. Longest Palindromic Substring DescriptionHintsSubmissionsDiscussSolution DiscussPick One Given a string s, find the longest palindromic substring i 阅读全文
posted @ 2017-08-09 19:21 Lawliet__zmz 阅读(138) 评论(0) 推荐(0) 编辑
摘要:3. Longest Substring Without Repeating Characters 3. Longest Substring Without Repeating Characters 3. Longest Substring Without Repeating Characters 阅读全文
posted @ 2017-08-07 17:23 Lawliet__zmz 阅读(154) 评论(0) 推荐(0) 编辑
摘要:2. Add Two Numbers 2. Add Two Numbers 2. Add Two Numbers 2. Add Two Numbers DescriptionHintsSubmissionsDiscussSolution DescriptionHintsSubmissionsDisc 阅读全文
posted @ 2017-08-04 18:09 Lawliet__zmz 阅读(114) 评论(0) 推荐(0) 编辑
摘要:260. Single Number III 260. Single Number III 260. Single Number III 260. Single Number III DescriptionHintsSubmissionsDiscussSolution DescriptionHint 阅读全文
posted @ 2017-08-04 10:44 Lawliet__zmz 阅读(132) 评论(0) 推荐(0) 编辑
摘要:137. Single Number II DescriptionHintsSubmissionsDiscussSolution DiscussPick One Given an array of integers, every element appears three times except 阅读全文
posted @ 2017-08-02 22:39 Lawliet__zmz 阅读(140) 评论(0) 推荐(0) 编辑
摘要:以前tao哥就讲过,想不到在Leetcode里面分类是一个Easy的问题。 另外Leetcode上只需要一个返回值,不需要main函数,跟平时刷的Oj系统还是不同的 阅读全文
posted @ 2017-08-02 17:15 Lawliet__zmz 阅读(145) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示