摘要:
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+
阅读(93)
推荐(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+
阅读(87)
推荐(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+
阅读(117)
推荐(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+
阅读(130)
推荐(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+
阅读(119)
推荐(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+
阅读(136)
推荐(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+
阅读(89)
推荐(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+
阅读(125)
推荐(0)
posted @ 2018-12-04 17:08
Sempron2800+
阅读(139)
推荐(0)
摘要:
补充一版python3的实现代码:
阅读全文
posted @ 2018-11-25 21:38
Sempron2800+
阅读(126)
推荐(0)