随笔分类 - Leetcode
自己完成的Leetcode,用于记录和分享。
摘要:Given a 32-bit signed integer, reverse digits of an integer. 给定一个范围为 32 位 int 的整数,将其颠倒。 该题对于JavaScript比较简单,给出的三个例子基本就把所有的难点都分别列出来了。 主要考虑几种情况。
阅读全文
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 长度
阅读全文
摘要:这一题对于JavaScript来说其实是比较简单的,JavaScript语言对于这一题很多步骤都有现成的API。 There are two sorted arrays nums1 and nums2 of size m and n respectively. 有两个大小为 m 和 n 的排序数组
阅读全文
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. 给定一个整数数列,找出其中和为特定值的那两个数。 You may assume that
阅读全文
摘要:首先,没有第二题,没有第二题的原因是,JavaScript中根本就没有那种数据结构,尽管我在playground里面调试出了正确的结果,但是也许是因为数据结构问题,最终没能让我通过。 所以我就抛弃第二题了。 Given a string, find the length of the longest
阅读全文

浙公网安备 33010602011771号