CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 2244. Minimum Rounds to Complete All Tasks

You are given a 0-indexed integer array tasks, where tasks[i] represents the difficulty level of a task. In each round, you can complete either 2 or 3 tasks of the same difficulty level. Return the mi
2023-01-04
#leetcode #array #hashmap #java #greedy #counting sort #math

[LeetCode] 2389. Longest Subsequence With Limited Sum

You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take fro
2022-12-25
#leetcode #array #java #greedy #prefix sum #sort #binary search

[LeetCode] 1760. Minimum Limit of Balls in a Bag

You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations. You can perform the following operation at most maxOperations times: Take any
2022-12-20
#leetcode #array #java #binary search #binary search on answer

[LeetCode] 1207. Unique Number of Occurrences

Given an array of integers arr, return true if the number of occurrences of each value in the array is unique, or false otherwise. Example 1:Input: arr = [1,2,2,1,1,3]Output: trueExplanation: The
2022-11-30
#leetcode #array #hashmap #java

[LeetCode] 1758. Minimum Changes To Make Alternating Binary String

You are given a string s consisting only of the characters ‘0’ and ‘1’. In one operation, you can change any ‘0’ to ‘1’ or vice versa. The string is called alternating if no two adjacent characters ar
2022-11-29
#leetcode #java #greedy #string

[LeetCode] 2225. Find Players With Zero or One Losses

You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match. Return a list answer of size 2 where:answer[0] is
2022-11-29
#leetcode #array #hashmap #java #sort

[LeetCode] 1768. Merge Strings Alternately

You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the e
2022-10-23
#leetcode #two pointer #java #string

[LeetCode] 1700. Number of Students Unable to Eat Lunch

The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sa
2022-10-19
#leetcode #array #java #greedy #simulation

[LeetCode] 1328. Break a Palindrome

Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the
2022-10-11
#leetcode #java #greedy #string

[LeetCode] 2007. Find Original Array From Doubled Array

An integer array original is transformed into a doubled array changed by appending twice the value of every element in original, and then randomly shuffling the resulting array. Given an array changed
2022-09-18
#leetcode #array #hashmap #java #greedy #sort
1…1617181920…41

Search

Hexo Fluid