[LeetCode] 994. Rotting Oranges You are given an m x n grid where each cell can have one of three values:0 representing an empty cell,1 representing a fresh orange, or2 representing a rotten orange.Every minute, any fresh orange tha 2020-04-16 #leetcode #bfs #java #javascript #array #flood fill
[LeetCode] 78. Subsets Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example 1:Input: num 2020-04-16 #leetcode #java #array #backtracking
[LeetCode] 523. Continuous Subarray Sum Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise. A good subarray is a subarray where:its length is at least two, andthe sum of the elements of 2020-04-15 #leetcode #java #javascript #array #hashmap #MOD #prefix sum #math
[LeetCode] 560. Subarray Sum Equals K Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. A subarray is a contiguous non-empty sequence of elements within an array. Example 1:Input 2020-04-14 #leetcode #java #javascript #array #hashmap #prefix sum
[LeetCode] 525. Contiguous Array Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1. Example 1:Input: nums = [0,1]Output: 2Explanation: [0, 1] is the longest contiguous 2020-04-14 #leetcode #java #javascript #array #hashmap #prefix sum
[LeetCode] 362. Design Hit Counter Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granularity) and you may assume that calls are being made t 2020-04-14 #leetcode #java #design
[LeetCode] 25. Reverse Nodes in k-Group Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or equal to the length of the linked list. If the num 2020-04-13 #leetcode #java #linked list
[LeetCode] 24. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes (i.e., only nodes themselves may be changed.) Exampl 2020-04-12 #leetcode #java #javascript #linked list
[LeetCode] 424. Longest Repeating Character Replacement You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times. Return the 2020-04-04 #leetcode #java #javascript #hashmap #two pointer #sliding window #string
[LeetCode] 209. Minimum Size Subarray Sum Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 ins 2020-04-03 #leetcode #java #javascript #array #two pointer #prefix sum #sliding window