GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

这里收录 Calf 在 GoCalf 上的文章、笔记与其他内容。

  • 105. Construct Binary Tree from Preorder and Inorder Traversal

    Coding

    #Problem Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. …

    medium
  • 1072. Flip Columns For Maximum Number of Equal Rows

    Coding

    #Problem You are given an m x n binary matrix matrix. You can choose any number of columns in the matrix and flip every cell in that column (i.e., Change the value of the cell from 0 to 1 or vice versa). Return the maximum number of rows …

    medium
  • 1079. Letter Tile Possibilities

    Coding

    #Problem You have n tiles, where each tile has one letter tiles[i] printed on it. Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles. …

    medium
  • 1092. Shortest Common Supersequence

    Coding

    #Problem Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them. A string s is a subsequence of string t if deleting some number of …

    hard
  • 11. Container With Most Water

    Coding

    #Problem You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that …

    medium
  • 1128. Number of Equivalent Domino Pairs

    Coding

    #Problem Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino. Return the …

    easy
  • 1143. Longest Common Subsequence

    Coding

    #Problem Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is a new string generated from the original string with some …

    medium
  • 118. Pascal’s Triangle

    Coding

    #Problem Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: https://leetcode.cn/problems/pascals-triangle/ pascalExample 1: …

    easy
  • 1186. Maximum Subarray Sum with One Deletion

    Coding

    #Problem Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to choose a subarray and optionally delete one element from it so that …

    medium
  • 119. Pascal's Triangle II

    Coding

    #Problem Given an integer rowIndex, return the rowIndexᵗʰ (0-indexed) row of the Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it as shown: …

    easy