題目:僅僅反轉字母 給定一個字串 S,返回 “反轉後的” 字串,其中不是字母的字元都保留在原地,而所有字母的位置發生反轉。複製程式碼 示例: 輸入:"ab-cd" 輸出:"dc-ba" 輸入:"a-bC-dEf-ghIj" 輸出:"j-Ih-gfE-dCba" 輸入:"Test1ng-Leet=code-Q!" 輸出:"Qedo1ct-eeLg=ntse-T!"複製程式碼 思考: ...
365 water-and-jug-problem JavaScript 中等 357 count-numbers-with-unique-digits JavaScript 中等 355 design-twitter JavaScript 中等 354 russian-doll-envelopes JavaScript 困难 350 intersection-of-two-arrays-ii JavaScript 简单 349 intersection-of-two-arrays JavaScript 简单 347 top-k-frequent-elements JavaS...
Chocolate Distribution Problem - GFG Convert an array to reduced form - GFG Course Schedule - GFG Delete middle element of a stack - GFG Find the element that appears once in sorted array - GFG Find the longest string - GFG ...
365 Water and Jug Problem 20.10% Medium 364 Nested List Weight Sum II $ 47.20% Medium 363 Max Sum of Rectangle No Larger Than K 27.00% Hard 362 Design Hit Counter $ 48.30% Medium 361 Bomb Enemy $ 32.60% Medium 360 Sort Transformed Array $ 40.80% Medium 359 Logger Rate Limiter $ 56.00...
365 Water and Jug Problem 20.10% Medium 364 Nested List Weight Sum II $ 47.20% Medium 363 Max Sum of Rectangle No Larger Than K 27.00% Hard 362 Design Hit Counter $ 48.30% Medium 361 Bomb Enemy $ 32.60% Medium 360 Sort Transformed Array $ 40.80% Medium 359 Logger Rate Limiter $ 56.00...
更高明的做法,是维护两个堆,一个是大堆,一个是小堆,大堆的数字都大于小堆里的数字,两个堆的数字均分这个数字。大堆用最小堆实现,小堆用最大堆实现。 当插入一个数,我们把它跟大堆的堆顶,也就大数字里的最小数对比,要是比它大,就入大堆,要是比它小,就入小堆,之后再调整两个堆,保证平均,调整只要...
365 水壶问题 - Water and Jug Problem C# C++ Java Python3 Medium 364 C# C++ Java Python3 Medium 363 矩形区域不超过 K 的最大数值和 - Max Sum of Rectangle No Larger Than K C# C++ Java Python3 Hard 362 C# C++ Java Python3 Medium 361 C# C++ Java Python3 Medium 360 C# C++ Java Python...
problem 1317: convert integer to the sum of two no zero integers February 24, 2020 16:50 1323.go problem 1323: maximum 69 number February 21, 2020 12:42 1331.go optimized for problem 1331 using map February 25, 2020 16:40 1332.go problem 1332: remove palindromic subsequences Feb...
363 Max Sum of Rectangle No Larger Than K Hard 27.00% 364 Nested List Weight Sum II $ Medium 47.20% 365 Water and Jug Problem Medium 20.10% 366 Find Leaves of Binary Tree $ Medium 53.60% 367 Valid Perfect Square Medium 36.60% 368 Largest Divisible Subset Medium 32.00% 369 Plus One Linke...
363 矩形区域不超过 K 的最大数值和 | Max Sum of Rectangle No Larger Than K Hard 364 Medium 365 水壶问题 | Water and Jug Problem Medium 366 Medium 367 有效的完全平方数 | Valid Perfect Square Easy 368 最大整除子集 | Largest Divisible Subset Medium 369 Medium 370 Medium 371 两整数之和 |...