1 题目描述 Given a linked list, swap every two adjacent nodes and return its head. Your algorithm should use only …
分类:LeetCode
49. Group Anagrams python
49. Group Anagrams python 题目: https://leetcode.com/problems/anagrams/ 难度 : Medium 我又来使用我的取巧神奇python大法 “c…
[LintCode][System Design] Toy Factory
Problem More LeetCode Discussions Factory is a design pattern in common usage. Please implement a ToyFactory w…
[LeetCode]709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. 将字…
[剑指offer] 用两个栈实现队列
本文首发于我的个人博客:尾尾部落 题目描述 用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 解题思路 两个栈 stack1 和 stack2: push 动作都在 stack1 中进…
445. Add Two Numbers II
Medium You are given two non-empty linked lists representing two non-negative integers. The most significant d…
[LeetCode] Elimination Game 淘汰游戏
There is a list of sorted integers from 1 to n. Starting from left to right, remove the first numb…
Inorder Successor in Binary Search Tree
Given a binary search tree and a node in it, find the in-order successor of that node in the BST. If the given…
Leetcode - Longest Palindrome
My code: public class Solution { public int longestPalindrome(String s) { if (s == null || s.length() == 0) { …
LeetCode刷题之Maximum Subarray
Problem Find the contiguous subarray within an array (containing at least one number) which has the largest su…
leetcode 20. 有用的括号
给定一个只包含 ‘(‘,’)’,'{‘,’}’,'[‘,’]’ 的字符串,推断字符串是不是有用。 有…
[Leetcode] Minimum Size Subarray Sum 最短子串和
Minimum Size Subarray Sum Given an array of n positive integers and a positive integer s, find the minimal len…