随笔分类 - leetcode
https://leetcode.com/problemset/all/
摘要:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given inte
阅读全文
摘要:You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exists a pe
阅读全文
摘要:Given an array A of non negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever A[i]
阅读全文
摘要:You are given a map in form of a two dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve
阅读全文
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp
阅读全文
摘要:A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com
阅读全文
摘要:Write a class StockSpanner which collects daily price quotes for some stock, and returns the span of that stock's price for the current day. The span
阅读全文
摘要:Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may ass
阅读全文
摘要:X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descrip
阅读全文
摘要:You are given an array A of strings. Two strings S and T are special equivalent if after any number of moves, S == T. A move consists of choosing two
阅读全文
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th
阅读全文
摘要:Given a positive integer N, find and return the longest distance between two consecutive 1's in the binary representation of N. If there aren't two co
阅读全文
摘要:Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string. Example 1: Inpu
阅读全文
摘要:Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation
阅读全文
摘要:Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O
阅读全文
摘要:Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positi
阅读全文
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: 1. Integer (one round's score): D
阅读全文
摘要:Given a non empty array of digits representing a non negative integer, plus one to the integer. The digits are stored such that the most significant d
阅读全文
摘要:Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi
阅读全文
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at
阅读全文

浙公网安备 33010602011771号