GoCalf Calf 的自留地 · 昙花一现

全站内容

easy

  • 206. Reverse Linked List

    Coding

    #Problem Given the head of a singly linked list, reverse the list, and return the reversed list. https://leetcode.com/problems/reverse-linked-list/ Example 1: case1Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Example 2: case2Input: head = …

    easy
  • 3248. Snake in Matrix

    Coding

    #Problem There is a snake in an n x n matrix grid and can move in four possible directions. Each cell in the grid is identified by the position: grid[i][j] = (i * n) + j. The snake starts at cell 0 and follows a sequence of commands. You …

    easy
  • 70. Climbing Stairs

    Coding

    #Problem You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? https://leetcode.com/problems/climbing-stairs/ Example 1: Input: n = …

    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
  • 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
  • 572. Subtree of Another Tree

    Coding

    #Problem Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a binary tree tree is a tree that consists of a …

    easy
  • 661. Image Smoother

    Coding

    #Problem An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If …

    easy
  • 21. Merge Two Sorted Lists

    Coding

    #Problem You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list. …

    easy
  • 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
  • 268. Missing Number

    Coding

    #Problem Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. https://leetcode.com/problems/missing-number/ Example 1: Input: nums = [3,0,1] Output: 2 …

    easy