![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
tjut_David_ncepu
这个作者很懒,什么都没留下…
展开
-
204. Count Primes Python代码
Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 算法的思想就是以此通过:22,33,44,55…ii;...原创 2019-05-21 11:17:14 · 257 阅读 · 0 评论 -
665. Non-decreasing Array Python代码
Non-decreasing Array Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decreasing if array[i] <= ar...原创 2019-05-16 16:59:47 · 172 阅读 · 0 评论 -
559. Maximum Depth of N-ary Tree Python代码
Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. For example, given a 3-ary tree: We shou...原创 2019-05-16 20:38:12 · 449 阅读 · 0 评论 -
859. Buddy Strings Python代码
Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example 1: Input: A = “ab”, B = “ba” Output: true Example 2: Input:...原创 2019-05-17 18:35:34 · 175 阅读 · 0 评论