LeetCode动态规划

LeetCode 动态规划 120. Triangle「DP」 Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4,1,8,3] ] The minimum path sum from top to bottom is 11 (i.e., 2 + 3 +

LeetCode二叉树

LeetCode二叉树 103. Binary Tree Zigzag Level Order Traversal「BFS」 Binary Tree Zigzag Level Order Traversal 之字形遍历二叉树。 仍然采用普通的队列,只是对于奇偶层,在保存改层结

LeetCode二分查找

LeetCode二分查找 33.Search in Rotated Sorted Array Search in Rotated Sorted Array 一个递增数组,随机rotate一下,(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).查找制定

Pandas

pandas dataframe isnull vs isna These two DataFrame methods do exactly the same thing! In short: To detect NaN values numpy uses np.isnan(). To detect NaN values pandas uses either .isna() or .isnull(). The NaN values are inherited from the fact that pandas is built on top of numpy, while the two functions’ names originate from R’s DataFrames, whose structure and functionality pandas tried to mimic. QA 基本操

LeetCode回溯&搜索

LeetCode回溯 77. Combinations Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 … n. 回溯即可: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 public List<List<Integer>> combine(int n, int k) { List<List<Integer>> ans = new ArrayList<>(); List<Integer>