摘要:
public class Solution { public int findPeakElement(int[] nums) { int left = 0; int right = nums.length - 1; while (left + 1 n... 阅读全文
摘要:
public class ZigzagIterator { private List v1; private List v2; private int p1; private int p2; private boolean flg = true; publ... 阅读全文
摘要:
public class Solution { List result = new ArrayList(); public List letterCombinations(String digits) { if (digits.length() == 0) { ... 阅读全文
摘要:
public class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { int carry = 0; ListNode result = new ListNode(0); ... 阅读全文
摘要:
思路和ugly2一样,不过是变成了一组factor,用一个priority求出每次最小的,同时维护一个conut数组,记录每个factor走的次数有一个500000的过不了,超限了,无耻的写了一行作弊的代码public class Solution { public int nthSuperU... 阅读全文
摘要:
public class Solution { public int removeElement(int[] nums, int val) { if (nums.length == 0) { return 0; } int lef... 阅读全文
摘要:
public class Solution { public String convert(String s, int numRows) { if (numRows == 1) { return s; } int flg = 0;... 阅读全文
摘要:
public class LRUCache { HashMap map = new HashMap(); ListNode start; ListNode end; int capacity; int cur_size; public LRUCache(int c... 阅读全文