Given a string s, return all the palindromic permutations (without duplicates) of it. Return an em…
分类:LeetCode
[LeetCode] Word Squares 单词平方
Given a set of words (without duplicates), find all word squares you can build from them…
[LeetCode] All Paths From Source to Target 从起点到目标点到所有路径
Given a directed, acyclic graph of N nodes. Find all possible paths from node 0&nb…
LeetCode 290 Word Pattern
题目描述 Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, s…
[剑指offer] 不用加减乘除做加法
本文首发于我的个人博客:尾尾部落 题目描述 写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。 解题思路 用位运算来实现。 step1: 进行异或运算,计算两个数各个位置上的相加,不考虑进位;…
Leetcode - 73. Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up: Did y…
[LeetCode] Spiral Matrix II 螺旋矩阵之二
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 i…
[LeetCode] Nim Game 尼姆游戏
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each t…
[LeetCode] Longest Increasing Subsequence 最长递增子序列,Longest Increasing Subsequence 最长递增子序列,Longest Increasing Subsequence 最长递增子序列
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input:…
[LeetCode] Remove Duplicate Letters 移除重复字母
Given a string which contains only lowercase letters, remove duplicate letters so that every letter app…
LeetCode | Subsets II
题目: Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: E…
412. Fizz Buzz
一、题目原型: 写一个程序,输出从 1 到 n 数字的字符串表示。 如果 n 是3的倍数,输出“Fizz”; 如果 n 是5的倍数,输出“Buzz”; 如果 n 同时是3和5的倍数,输出 “FizzBuzz”。 二、示例…