LeetCode: 581-Shortest Unsorted Continuous Subarray 解題紀錄
題目
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
, 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.
Given the root
of a binary search tree, and an integer k
, return the kth
smallest value (1-indexed) of all the values of the nodes in the tree.
Given the root
of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.
You are keeping score for a baseball game with strange rules. The game consists of several rounds, where the scores of past rounds may affect future rounds’ scores.
Read More »LeetCode: 682-Baseball Game 解題紀錄You are given an array of integers stones
where stones[i]
is the weight of the ith
stone.
Given a string s
, return true
if the s
can be palindrome after deleting at most one character from it.
Write a function that reverses a string. The input string is given as an array of characters s
.
Given an array nums
which consists of non-negative integers and an integer m
, you can split the array into m
non-empty continuous subarrays.