GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

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

  • 190. Reverse Bits

    Coding

    #Problem Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not …

    easy
  • 191. Number of 1 Bits

    Coding

    #Problem Given a positive integer n, write a function that returns the number of set bits in its binary representation (also known as the Hamming weight). A set bit refers to a bit in the binary representation of a number that has a value …

    easy
  • 1910. Remove All Occurrences of a Substring

    Coding

    #Problem Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed: Find the leftmost occurrence of the substring part and remove it from s. Return s after removing all …

    medium
  • 1930. Unique Length-3 Palindromic Subsequences

    Coding

    #Problem Given a string s, return the number of unique palindromes of length three that are a subsequence of s. Note that even if there are multiple ways to obtain the same subsequence, it is still only counted once. A palindrome is a …

    medium
  • 1957. Delete Characters to Make Fancy String

    Coding

    #Problem A fancy string is a string where no three consecutive characters are equal. Given a string s, delete the minimum possible number of characters from s to make it fancy. Return the final string after the deletion. It can be shown …

    easy
  • 198. House Robber

    Coding

    #Problem You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems …

    medium
  • 1980. Find Unique Binary String

    Coding

    #Problem Given an array of strings nums containing n unique binary strings each of length n, return a binary string of length n that does not appear in nums. If there are multiple answers, you may return any of them. …

    medium
  • 1982. Find Array Given Subset Sums

    Coding

    #Problem You are given an integer n representing the length of an unknown array that you are trying to recover. You are also given an array sums containing the values of all 2ⁿ subset sums of the unknown array (in no particular order). …

    hard difficult
  • 2. Add Two Numbers

    Coding

    #Problem You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You …

    medium
  • 20. Valid Parentheses

    Coding

    #Problem Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be …

    easy