REVERSE!REVERSE!REVERSE!

形式汇总:

206. Reverse Linked List

92. Reverse Linked List II:Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string.

 

344. Reverse String:Given s = "hello", return "olleh".

151. Reverse Words in a String:For example,Given s = "the sky is blue",return "blue is sky the". 去掉空格后,用string builder函数

 541. Reverse String II:Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse all of them.

557. Reverse Words in a String III:Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

345. Reverse Vowels of a String

 

7. Reverse Integer :120-21:用*10,%10

190. Reverse Bits:位运算

189. Rotate Array:with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].

 

493. Reverse Pairs:i < j and nums[i] > 2*nums[j]

posted @ 2017-11-28 14:36  苗妙苗  阅读(127)  评论(0编辑  收藏  举报