[LeetCode] 18. 4Sum Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:0 <= a, b, c, d < na, b, c, and d are distinct.nums[a] + nums 2020-04-26 #leetcode #array #two pointer #java #javascript #two sum
[LeetCode] 80. Remove Duplicates from Sorted Array II Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative order of the elements should be kept the s 2020-04-22 #leetcode #array #two pointer #java #javascript
[LeetCode] 1248. Count Number of Nice Subarrays Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it. Return the number of nice sub-arrays. Example 1:Input: nums = [1,1,2,1,1], 2020-04-21 #leetcode #array #two pointer #hashmap #java #prefix sum
[LeetCode] 36. Valid Sudoku Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:Each row must contain the digits 1-9 without repetition.Each column must contain 2020-04-20 #leetcode #array #hashmap #java #string
[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 #array #java #javascript #bfs #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 #array #java #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 #array #hashmap #java #javascript #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 #array #hashmap #java #javascript #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 #array #hashmap #java #javascript #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