C/C++
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.
LeetCode: 446-Arithmetic Slices II – Subsequence 解題紀錄
題目
Given an integer array nums
, return the number of all the arithmetic subsequences of nums
.
LeetCode: 2486-Append Characters to String to Make Subsequence 解題紀錄
題目
ou are given two strings s
and t
consisting of only lowercase English letters.
Return the minimum number of characters that need to be appended to the end of s
so that t
becomes a subsequence of s
.
LeetCode: 2485-Find the Pivot Integer 解題紀錄
題目
Given a positive integer n
, find the pivot integer x
such that:
- The sum of all elements between
1
andx
inclusively equals the sum of all elements betweenx
andn
inclusively.
LeetCode: 79-Word Search 解題紀錄
題目
Given an m x n
grid of characters board
and a string word
, return true
if word
exists in the grid.
LeetCode: 1926-Nearest Exit from Entrance in Maze 解題紀錄
題目
You are given an m x n
matrix maze
(0-indexed) with empty cells (represented as '.'
) and walls (represented as '+'
). You are also given the entrance
of the maze, where entrance = [entrancerow, entrancecol]
denotes the row and column of the cell you are initially standing at.