Baihu Qian 钱柏湖
  • Posts
  • Tag Index
  • Search
Navigation bar avatar
✕

    Posts

    • Leetcode 351: Android Unlock Patterns

      Posted on August 12, 2018

      Question Given an Android 3x3 key lock screen and two integers m and n, where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock screen, which consist of minimum of m keys and maximum n keys. [Read More]
      Tags:
      • Leetcode
      • Backtracking
      • Review
    • Leetcode 310: Minimum Height Trees

      Posted on August 11, 2018

      Question For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called minimum height trees (MHTs). Given such a graph, write a function to find all the... [Read More]
      Tags:
      • Leetcode
      • BFS
    • Leetcode 348: Design Tic-Tac-Toe

      Posted on August 11, 2018

      Question Design a Tic-tac-toe game that is played between two players on a n x n grid. [Read More]
      Tags:
      • Leetcode
    • Leetcode 347: Top K Frequent Elements

      Posted on August 11, 2018

      Question Given a non-empty array of integers, return the k most frequent elements. [Read More]
      Tags:
      • Leetcode
    • Leetcode 345: Reverse Vowels of a String

      Posted on August 11, 2018

      Question Write a function that takes a string as input and reverse only the vowels of a string. [Read More]
      Tags:
      • Leetcode
    • Leetcode 343: Integer Break

      Posted on August 11, 2018

      Question Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. [Read More]
      Tags:
      • Leetcode
    • Leetcode 341: Flatten Nested List Iterator

      Posted on August 11, 2018

      Question Given a nested list of integers, implement an iterator to flatten it. [Read More]
      Tags:
      • Leetcode
    • Leetcode 337: House Robber III

      Posted on August 11, 2018

      Question The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that “all houses in this place forms... [Read More]
      Tags:
      • Leetcode
    • Leetcode 334: Increasing Triplet Subsequence

      Posted on August 11, 2018

      Question Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. [Read More]
      Tags:
      • Leetcode
    • Leetcode 333: Largest BST Subtree

      Posted on August 11, 2018

      Question Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. [Read More]
      Tags:
      • Leetcode
    • Leetcode 332: Reconstruct Itinerary

      Posted on August 11, 2018

      Question Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from JFK. Thus, the itinerary must begin with JFK. [Read More]
      Tags:
      • Leetcode
      • DFS
      • Review
    • Leetcode 331: Verify Preorder Serialization of a Binary Tree

      Posted on August 11, 2018

      Question One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node’s value. If it is a null node, we record using a sentinel value such as #. [Read More]
      Tags:
      • Leetcode
    • Leetcode 325: Maximum Size Subarray Sum Equals k

      Posted on August 11, 2018

      Question Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn’t one, return 0 instead. [Read More]
      Tags:
      • Leetcode
      • Review
      • DP
    • Leetcode 338: Counting Bits

      Posted on August 11, 2018

      Question iven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array. [Read More]
      Tags:
      • Leetcode
      • DP
    • Leetcode 322: Coin Change

      Posted on August 10, 2018

      Question You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.... [Read More]
      Tags:
      • Leetcode
      • DP
    • ← Newer Posts
    • Older Posts →
    • Email me
    • GitHub
    • LinkedIn
    • Instagram

    Baihu Qian  •  2025  •  baihuqian.github.io  •  Edit page

    Powered by Beautiful Jekyll