CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 438. Find All Anagrams in a String

Given two strings s and p, return an array of all the start indices of p’s anagrams in s. You may return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a
2020-04-03
#leetcode #java #javascript #hashmap #two pointer #sliding window #string

[LeetCode] 159. Longest Substring with At Most Two Distinct Characters

Given a string s, return the length of the longest substring that contains at most two distinct characters. Example 1:Input: s = “eceba”Output: 3Explanation: The substring is “ece” which its leng
2020-04-03
#leetcode #java #javascript #hashmap #two pointer #sliding window #string

[LeetCode] 340. Longest Substring with At Most K Distinct Characters

Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters. Example 1:Input: s = “eceba”, k = 2Output: 3Explanation: The s
2020-04-03
#leetcode #java #javascript #hashmap #two pointer #sliding window #string

[LeetCode] 3. Longest Substring Without Repeating Characters

Given a string s, find the length of the longest substring without repeating characters. Example 1:Input: s = “abcabcbb”Output: 3Explanation: The answer is “abc”, with the length of 3. Example 2:
2020-04-03
#leetcode #java #javascript #hashmap #two pointer #sliding window #string

[LeetCode] 76. Minimum Window Substring

Given two strings s and t of lengths m and n respectively, return the minimum windowsubstring of s such that every character in t (including duplicates) is included in the window. If there is no such
2020-04-03
#leetcode #java #javascript #hashmap #two pointer #sliding window #string

[LeetCode] 419. Battleships in a Board

Given an m x n matrix board where each cell is a battleship ‘X’ or empty ‘.’, return the number of the battleships on board. Battleships can only be placed horizontally or vertically on board. In othe
2020-04-01
#leetcode #java #array #binary search

[LeetCode] 1002. Find Common Characters

Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order. Example 1:Input: words =
2020-03-31
#leetcode #java #array #hashmap

[LeetCode] 999. Available Captures for Rooks

You are given an 8 x 8 matrix representing a chessboard. There is exactly one white rook represented by ‘R’, some number of white bishops ‘B’, and some number of black pawns ‘p’. Empty squares are rep
2020-03-27
#leetcode #java #array #matrix #simulation

[LeetCode] 201. Bitwise AND of Numbers Range

Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive. Example 1:Input: left = 5, right = 7Output: 4 Exampl
2020-03-25
#leetcode #java #javascript #bit manipulation

[LeetCode] 151. Reverse Words in a String

Given an input string, reverse the string word by word. Example 1:Input: “the sky is blue”Output: “blue is sky the” Example 2:Input: “ hello world! “Output: “world! hello”Explanation: Your reversed
2020-03-24
#leetcode #java #javascript #two pointer #string
1…3233343536…43

Search

Hexo Fluid