上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 114 下一页
摘要: public class Solution { public int LargestPerimeter(int[] A) { var list = A.OrderByDescending(x => x).ToList(); var length = list.Count; if (le... 阅读全文
posted @ 2019-01-22 10:25 Sempron2800+ 阅读(91) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int[] SortedSquares(int[] A) { return A.Select(x => x * x).ToList().OrderBy(x => x).ToArray(); } } Java版代码: 1 class Sol 阅读全文
posted @ 2019-01-22 10:06 Sempron2800+ 阅读(80) 评论(0) 推荐(0) 编辑
摘要: public class POINT { public int X; public int Y; public int Z; } public class Solution { public int[][] KClosest(int[][] points, int K) { ... 阅读全文
posted @ 2019-01-22 09:55 Sempron2800+ 阅读(114) 评论(0) 推荐(0) 编辑
摘要: public class Solution { List list = new List(); private void postTree(TreeNode root) { if (root != null) { list.Add(root.val); ... 阅读全文
posted @ 2019-01-08 12:38 Sempron2800+ 阅读(126) 评论(0) 推荐(0) 编辑
摘要: class Solution: def repeatedNTimes(self, A): doubleN = len(A) N = doubleN / 2 dic = {} for a in A: if a in dic.keys(): dic[a]=dic[a]+1 ... 阅读全文
posted @ 2018-12-23 16:22 Sempron2800+ 阅读(115) 评论(0) 推荐(0) 编辑
摘要: from queue import Queue class Solution: def deckRevealedIncreasing(self, deck): n = len(deck) que = Queue(maxsize=n) deck.sort() res = [0]*n for i in rang... 阅读全文
posted @ 2018-12-13 20:54 Sempron2800+ 阅读(132) 评论(0) 推荐(0) 编辑
摘要: class Solution: def __init__(self): self.li = [] def midSearch(self,node): if(node != None): self.midSearch(node.left) self.li.append(node.val) ... 阅读全文
posted @ 2018-12-13 10:50 Sempron2800+ 阅读(84) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public bool IsAlienSorted(string[] words, string order) { string HumanDic = "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i x).ToA... 阅读全文
posted @ 2018-12-09 19:02 Sempron2800+ 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 这题又长又卵,没意思。 阅读全文
posted @ 2018-12-04 17:08 Sempron2800+ 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 补充一版python3的实现代码: 阅读全文
posted @ 2018-11-25 21:38 Sempron2800+ 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 114 下一页