随笔分类 - 待分类 / 05_题目练习 / 05_Python题目练习
摘要:Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root n
阅读全文
摘要:Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they a
阅读全文
摘要:Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: ``` Input: root = [1,null,2,3] Output: [1,3,2] ``` Exam
阅读全文
摘要:Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. **Examp
阅读全文
摘要: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
阅读全文
摘要:Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.
阅读全文
摘要:Given two binary strings a and b, return their sum as a binary string. **Example 1:** ``` Input: a = "11", b = "1" Output: "100" ``` **Example 2:** ``
阅读全文
摘要:Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-spa
阅读全文
摘要:Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if i
阅读全文
摘要:> 题目描述太复杂, 意思就是移除数组中给定的元素 Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements ma
阅读全文
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:
阅读全文
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string ```""```.
阅读全文
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. ``` Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 ``` For examp
阅读全文

浙公网安备 33010602011771号