题目 Implement atoi which converts a string to an integer. The function first discards as...
题目 Implement atoi which converts a string to an integer. The function first discards as...
题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: E...
题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows...
题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the m...
题目 Given a string s, find the longest palindromic substring in s. You may assume that t...
题目 描述 现在有两个字符串,可以在字符串的任意位置(开头,中间,末尾)插入任意数量的空格.在插入适当数量的空格后,将两个字符串右对齐,通过一定的规则获得一个匹配值X,你的任...
题目 描述 在一场DOTA战争中,影魔终于获得获得了传说中的闪烁匕首,也就用了闪烁技能,但是闪烁有个缺陷——我们把地图看做N*N的点阵,假设影魔在点(x,y)上,那么闪烁只能...
[1,2]
[-1,3]
这种情况呢
2018-03-28 两个序列的中位数题目来源:《算法设计与分析》第二版 一.问题:求两个等长升序序列的中位数。 这个题目在前面发表的leetcode题目是一样的。 二.分析: 1. 第一种思路 求中位数,中位数...
二叉树的遍历是二叉树的经典算法,方式有很多,对理解递归迭代和堆栈队列有帮助。以下是我写的二叉树深度优先遍历(DFS)和广度优先遍历(BFS)的递归和非递归形式,并顺便介绍一下...
题目 Given a string, find the length of the longest substring without repeating character...