Loading

随笔分类 -  待分类 / 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 阅读全文
posted @ 2023-06-30 10:02 Artwalker 阅读(26) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-28 10:24 Artwalker 阅读(28) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-27 14:08 Artwalker 阅读(25) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-21 12:15 Artwalker 阅读(22) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-19 11:59 Artwalker 阅读(21) 评论(0) 推荐(0)
摘要: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. 阅读全文
posted @ 2023-06-19 10:16 Artwalker 阅读(29) 评论(0) 推荐(0)
摘要: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:** `` 阅读全文
posted @ 2023-06-15 11:07 Artwalker 阅读(21) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-14 10:41 Artwalker 阅读(30) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-14 10:34 Artwalker 阅读(15) 评论(0) 推荐(0)
摘要:> 题目描述太复杂, 意思就是移除数组中给定的元素 Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements ma 阅读全文
posted @ 2023-06-14 10:12 Artwalker 阅读(26) 评论(0) 推荐(0)
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 阅读全文
posted @ 2023-06-13 13:36 Artwalker 阅读(13) 评论(0) 推荐(0)
摘要: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 ```""```. 阅读全文
posted @ 2023-06-13 10:20 Artwalker 阅读(16) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2023-06-12 10:37 Artwalker 阅读(11) 评论(0) 推荐(0)

Live2D