java leetcode481-Magical-String 这题是描述了一个魔法字符串,该字符串完全由数字1和2构成。这个字符串的魔法点在于,如果将该该字符串连续的数字数量进行统计并且构成一个新的字符串,会发现新的字符串与原来的字符串完全相同。比如1 22 11 2 1 22 1 22 11 2 11 22字符串,经过统计后发现有1个1,2个2,2个1,1个2,1个1,2个2,1个1,2个2,2个1,1个…
java [LeetCode] 876. Middle of the Linked List Given a non-empty, singly linked list with head node head, return a middle node of linked list.
java [LeetCode] 905. Sort Array By Parity Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
java [LeetCode] 487. Max Consecutive Ones II Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0.