摘要:
class Solution { public String removeDuplicateLetters(String s) { int[] lastIndex = new int[26]; for (int i = 0; i < s.length(); i++){ lastIndex[s.cha 阅读全文
摘要:
This is the similar problem with: https://www.cnblogs.com/feiflytech/p/16169025.html class Solution { public int[] dailyTemperatures(int[] t) { int[] 阅读全文
摘要:
This problem is as same as https://www.cnblogs.com/feiflytech/p/16169025.html class Solution { public int[] nextLargerNodes(ListNode head) { List<Inte 阅读全文
摘要:
This is a similiar problem with https://www.cnblogs.com/feiflytech/p/15862432.html The only differences are: 1. If no larger number can be returned, t 阅读全文
摘要:
This is the similiar problem with: https://www.cnblogs.com/feiflytech/p/16168587.html and https://www.cnblogs.com/feiflytech/p/16169025.html class Sol 阅读全文
摘要:
Using stack, two pass: class Solution { public int[] nextGreaterElements(int[] nums) { Stack<Integer> stk = new Stack<>(); int[] res = new int[nums.le 阅读全文
摘要:
My solution, time complexity O(m*n): class Solution { public int[] nextGreaterElement(int[] nums1, int[] nums2) { Map<Integer, Integer> map = new Hash 阅读全文
摘要:
My binary search solution: class Solution { public int[] searchRange(int[] nums, int target) { if(nums==null || nums.length==0) return new int[]{-1,-1 阅读全文