GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

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

  • 91. Decode Ways

    Coding

    #Problem You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping: "1" -> 'A' "2" -> 'B' ... "25" -> 'Y' "26" -> 'Z' However, while decoding the message, you realize that there …

    medium
  • 913. Cat and Mouse

    Coding

    #Problem A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph. The mouse starts at node 1 and goes …

    hard
  • 916. Word Subsets

    Coding

    #Problem You are given two string arrays words1 and words2. A string b is a subset of string a if every letter in b occurs in a including multiplicity. For example, "wrr" is a subset of "warrior" but is not a subset of "world". A string a …

    medium
  • 922. Sort Array By Parity II

    Coding

    #Problem Given an array of integers nums, half of the integers in nums are odd, and the other half are even. Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even. Return any answer array that …

    easy
  • 935. Knight Dialer

    Coding

    #Problem The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an L). The possible movements of chess …

    medium
  • 95. Unique Binary Search Trees II

    Coding

    #Problem Given an integer n, return all the structurally unique BST’s (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in any order. …

    medium
  • 954. Array of Doubled Pairs

    Coding

    #Problem Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise. …

    medium
  • 96. Unique Binary Search Trees

    Coding

    #Problem Given an integer n, return the number of structurally unique BST’s (binary search trees) which has exactly n nodes of unique values from 1 to n. https://leetcode.com/problems/unique-binary-search-trees/ Example 1: case1Input: n = 3 …

    medium
  • 98. Validate Binary Search Tree

    Coding

    #Problem Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node …

    medium
  • 983. Minimum Cost For Tickets

    Coding

    #Problem You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365. Train tickets are sold in three different ways: a …

    medium