CNoodle
  • Home
  • Archives
  • Tags
  • About

[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 #java #array #hashmap #sort

[LeetCode] 2133. Check if Every Row and Column Contains All Numbers

An n x n matrix is valid if every row and every column contains all the integers from 1 to n (inclusive). Given an n x n integer matrix matrix, return true if the matrix is valid. Otherwise, return fa
2022-11-23
#leetcode #java #array #hashmap #matrix

[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 #java #two pointer #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 #java #array #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 #java #array #hashmap #greedy #sort

[LeetCode] 1608. Special Array With X Elements Greater Than or Equal X

You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x. Notice th
2022-09-12
#leetcode #java #array #counting sort #sort #binary search #binary search on answer

[LeetCode] 1184. Distance Between Bus Stops

A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n.
2022-07-24
#leetcode #java #array

[LeetCode] 828. Count Unique Characters of All Substrings of a Given String

Let’s define a function countUniqueChars(s) that returns the number of unique characters in s. For example, calling countUniqueChars(s) if s = “LEETCODE” then “L”, “T”, “C”, “O”, “D” are the uniq
2022-07-12
#leetcode #java #hashmap #string

[LeetCode] 729. My Calendar I

You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty interse
2022-07-05
#leetcode #java #treemap #design
1…1819202122…47

Search

Hexo Fluid