CNoodle
  • Home
  • Archives
  • Tags
  • About

[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

[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 #two pointer #hashmap #java #javascript #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 #array #two pointer #java #javascript #prefix sum #sliding window

[LeetCode] 438. Find All Anagrams in a String

Given two strings s and p, return an array of all the start indices of p’s anagrams in s. You may return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a
2020-04-03
#leetcode #two pointer #hashmap #java #javascript #sliding window #string

[LeetCode] 159. Longest Substring with At Most Two Distinct Characters

Given a string s, return the length of the longest substring that contains at most two distinct characters. Example 1:Input: s = “eceba”Output: 3Explanation: The substring is “ece” which its leng
2020-04-03
#leetcode #two pointer #hashmap #java #javascript #sliding window #string

[LeetCode] 340. Longest Substring with At Most K Distinct Characters

Given a string s and an integer k, return the length of the longest substring of s that contains at most k distinct characters. Example 1:Input: s = “eceba”, k = 2Output: 3Explanation: The s
2020-04-03
#leetcode #two pointer #hashmap #java #javascript #sliding window #string
1…3435363738…46

Search

Hexo Fluid