[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 #array #hashmap #java
[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 #array #java #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 st 2020-03-24 #leetcode #two pointer #java #javascript #string
[LeetCode] 62. Unique Paths There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot ca 2020-03-23 #leetcode #array #java #javascript #dynamic programming
[LeetCode] 876. Middle of the Linked List Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. Example 1:Input: [1,2,3,4,5]Output: Node 3 2020-03-23 #leetcode #two pointer #java #javascript #linked list
[LeetCode] 17. Letter Combinations of a Phone Number Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like 2020-03-23 #leetcode #java #string #backtracking
[LeetCode] 129. Sum Root to Leaf Numbers You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. For example, the root-to-leaf path 1 -> 2 -> 3 represents the 2020-03-22 #leetcode #java #javascript #tree #dfs #preorder
[LeetCode] 222. Count Complete Tree Nodes Given the root of a complete binary tree, return the number of the nodes in the tree. According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and 2020-03-22 #leetcode #java #tree #binary search #divide and conquer
[LeetCode] 230. Kth Smallest Element in a BST Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1:Input: root = [3,1,4,null,2], k = 1O 2020-03-20 #leetcode #java #javascript #tree #inorder #BST