LeetCode: 985-Sum of Even Numbers After Queries 解題紀錄
題目
You are given an integer array nums
and an array queries
where queries[i] = [vali, indexi]
.
You are given an integer array nums
and an array queries
where queries[i] = [vali, indexi]
.
Given a list paths
of directory info, including the directory path, and all the files with contents in this directory, return all the duplicate files in the file system in terms of their paths. You may return the answer in any order.
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 a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.
Read More »LeetCode: 1457-Pseudo-Palindromic Paths in a Binary Tree 解題紀錄Given an integer array data
representing the data, return whether it is a valid UTF-8 encoding (i.e. it translates to a sequence of valid UTF-8 encoded characters).
You have an initial power of power
, an initial score of 0
, and a bag of tokens
where tokens[i]
is the value of the ith
token (0-indexed).
You are given an integer array nums
and an integer x
. In one operation, you can either remove the leftmost or the rightmost element from the array nums
and subtract its value from x
. Note that this modifies the array for future operations.
Given an integer array nums
, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order.
Given an integer array nums
, move all the even integers at the beginning of the array followed by all the odd integers.
Given two strings s
and t
, return true
if they are equal when both are typed into empty text editors. '#'
means a backspace character.