blob_id stringlengths 40 40 | repo_name stringlengths 5 127 | path stringlengths 2 523 | length_bytes int64 22 545k | score float64 3.5 5.34 | int_score int64 4 5 | text stringlengths 22 545k |
|---|---|---|---|---|---|---|
0eec00ac476fae7a4b3d79d3e7a18a268c637304 | chenxu0602/LeetCode | /260.single-number-iii.py | 1,431 | 3.609375 | 4 | #
# @lc app=leetcode id=260 lang=python3
#
# [260] Single Number III
#
# https://leetcode.com/problems/single-number-iii/description/
#
# algorithms
# Medium (59.44%)
# Likes: 1162
# Dislikes: 90
# Total Accepted: 125.3K
# Total Submissions: 210.8K
# Testcase Example: '[1,2,1,3,2,5]'
#
# Given an array of number... |
f94e11776b50f008291eccfc578ae3379b7887ea | chenxu0602/LeetCode | /106.construct-binary-tree-from-inorder-and-postorder-traversal.py | 1,814 | 3.890625 | 4 | #
# @lc app=leetcode id=106 lang=python3
#
# [106] Construct Binary Tree from Inorder and Postorder Traversal
#
# https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/
#
# algorithms
# Medium (42.99%)
# Likes: 1279
# Dislikes: 27
# Total Accepted: 193K
# Total Submi... |
4d30ffcfb095248673a60acbeffa23ef80c2a844 | chenxu0602/LeetCode | /1701.average-waiting-time.py | 3,163 | 3.84375 | 4 | #
# @lc app=leetcode id=1701 lang=python3
#
# [1701] Average Waiting Time
#
# https://leetcode.com/problems/average-waiting-time/description/
#
# algorithms
# Medium (61.38%)
# Likes: 70
# Dislikes: 11
# Total Accepted: 6.2K
# Total Submissions: 10.1K
# Testcase Example: '[[1,2],[2,5],[4,3]]'
#
# There is a rest... |
62f9f166001eee5820763c9f96a02e26068367a8 | chenxu0602/LeetCode | /355.design-twitter.py | 3,438 | 4.1875 | 4 | #
# @lc app=leetcode id=355 lang=python3
#
# [355] Design Twitter
#
# https://leetcode.com/problems/design-twitter/description/
#
# algorithms
# Medium (27.39%)
# Likes: 483
# Dislikes: 139
# Total Accepted: 35K
# Total Submissions: 127.3K
# Testcase Example: '["Twitter","postTweet","getNewsFeed","follow","postT... |
c8e11c56e38132b6e62adf5f61c527c7c003874d | chenxu0602/LeetCode | /1447.simplified-fractions.py | 1,510 | 3.609375 | 4 | #
# @lc app=leetcode id=1447 lang=python3
#
# [1447] Simplified Fractions
#
# https://leetcode.com/problems/simplified-fractions/description/
#
# algorithms
# Medium (61.52%)
# Likes: 111
# Dislikes: 23
# Total Accepted: 12.8K
# Total Submissions: 20.9K
# Testcase Example: '2\r'
#
# Given an integer n, return a ... |
370c171eb3249f565df27cdb2cc81f85aefbffd4 | chenxu0602/LeetCode | /1518.water-bottles.py | 1,647 | 3.828125 | 4 | #
# @lc app=leetcode id=1518 lang=python3
#
# [1518] Water Bottles
#
# https://leetcode.com/problems/water-bottles/description/
#
# algorithms
# Easy (63.98%)
# Likes: 129
# Dislikes: 15
# Total Accepted: 13.4K
# Total Submissions: 21K
# Testcase Example: '9\n3'
#
# Given numBottles full water bottles, you can e... |
3dbfa0e9e4b4194aea4ed41848f0035087777728 | chenxu0602/LeetCode | /200.number-of-islands.py | 1,889 | 3.59375 | 4 | #
# @lc app=leetcode id=200 lang=python3
#
# [200] Number of Islands
#
# https://leetcode.com/problems/number-of-islands/description/
#
# algorithms
# Medium (44.58%)
# Likes: 4056
# Dislikes: 150
# Total Accepted: 539.1K
# Total Submissions: 1.2M
# Testcase Example: '[["1","1","1","1","0"],["1","1","0","1","0"]... |
15c81a6ede310a73515ddb2c99bed416f4179676 | chenxu0602/LeetCode | /1791.find-center-of-star-graph.py | 1,316 | 3.953125 | 4 | #
# @lc app=leetcode id=1791 lang=python3
#
# [1791] Find Center of Star Graph
#
# https://leetcode.com/problems/find-center-of-star-graph/description/
#
# algorithms
# Medium (84.89%)
# Likes: 63
# Dislikes: 164
# Total Accepted: 12.8K
# Total Submissions: 15.1K
# Testcase Example: '[[1,2],[2,3],[4,2]]'
#
# The... |
38aca918cd6a434b69e7a98fa6d7149d79e6ed49 | chenxu0602/LeetCode | /1040.moving-stones-until-consecutive-ii.py | 2,394 | 3.796875 | 4 | #
# @lc app=leetcode id=1040 lang=python3
#
# [1040] Moving Stones Until Consecutive II
#
# https://leetcode.com/problems/moving-stones-until-consecutive-ii/description/
#
# algorithms
# Medium (51.55%)
# Likes: 117
# Dislikes: 187
# Total Accepted: 3.8K
# Total Submissions: 7.3K
# Testcase Example: '[7,4,9]'
#
... |
b707c527d904ea45c98146a6b1537a1c6fbfc38d | chenxu0602/LeetCode | /1689.partitioning-into-minimum-number-of-deci-binary-numbers.py | 1,216 | 3.671875 | 4 | #
# @lc app=leetcode id=1689 lang=python3
#
# [1689] Partitioning Into Minimum Number Of Deci-Binary Numbers
#
# https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/description/
#
# algorithms
# Medium (88.28%)
# Likes: 48
# Dislikes: 32
# Total Accepted: 5.7K
# Total Submissions... |
bdcb699633ae22ddccf5eec87f11c164931a06a7 | chenxu0602/LeetCode | /1190.reverse-substrings-between-each-pair-of-parentheses.py | 2,140 | 3.78125 | 4 | #
# @lc app=leetcode id=1190 lang=python3
#
# [1190] Reverse Substrings Between Each Pair of Parentheses
#
# https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/description/
#
# algorithms
# Medium (59.32%)
# Likes: 211
# Dislikes: 10
# Total Accepted: 11.4K
# Total Submissions: 19.1... |
774b6cd02fc07538d7de90ef6fee52731ba22444 | chenxu0602/LeetCode | /800.similar-rgb-color.py | 2,340 | 3.75 | 4 | #
# @lc app=leetcode id=800 lang=python3
#
# [800] Similar RGB Color
#
# https://leetcode.com/problems/similar-rgb-color/description/
#
# algorithms
# Easy (61.31%)
# Likes: 60
# Dislikes: 374
# Total Accepted: 10.4K
# Total Submissions: 16.9K
# Testcase Example: '"#09f166"'
#
# In the following, every capital l... |
b30bcd8665e6a6fa4d720574becc1bc7497fdc72 | chenxu0602/LeetCode | /1753.maximum-score-from-removing-stones.py | 2,561 | 3.65625 | 4 | #
# @lc app=leetcode id=1753 lang=python3
#
# [1753] Maximum Score From Removing Stones
#
# https://leetcode.com/problems/maximum-score-from-removing-stones/description/
#
# algorithms
# Medium (60.87%)
# Likes: 115
# Dislikes: 15
# Total Accepted: 8.6K
# Total Submissions: 14.1K
# Testcase Example: '2\n4\n6'
#
... |
ff9c2cea663a40b53c21209d0365b0a53be4797d | chenxu0602/LeetCode | /1015.smallest-integer-divisible-by-k.py | 1,411 | 3.5625 | 4 | #
# @lc app=leetcode id=1015 lang=python3
#
# [1015] Smallest Integer Divisible by K
#
# https://leetcode.com/problems/smallest-integer-divisible-by-k/description/
#
# algorithms
# Medium (29.30%)
# Likes: 62
# Dislikes: 190
# Total Accepted: 7K
# Total Submissions: 23.4K
# Testcase Example: '1'
#
# Given a posi... |
03580dc2922f2e7fa6941d583c51258413d53275 | chenxu0602/LeetCode | /1025.divisor-game.py | 1,143 | 3.734375 | 4 | #
# @lc app=leetcode id=1025 lang=python3
#
# [1025] Divisor Game
#
# https://leetcode.com/problems/divisor-game/description/
#
# algorithms
# Easy (64.19%)
# Likes: 157
# Dislikes: 462
# Total Accepted: 25.1K
# Total Submissions: 38.4K
# Testcase Example: '2'
#
# Alice and Bob take turns playing a game, with Al... |
837cb86a262a912d48f93db3d83b5e46a086705d | chenxu0602/LeetCode | /1537.get-the-maximum-score.py | 3,749 | 3.703125 | 4 | #
# @lc app=leetcode id=1537 lang=python3
#
# [1537] Get the Maximum Score
#
# https://leetcode.com/problems/get-the-maximum-score/description/
#
# algorithms
# Hard (36.11%)
# Likes: 273
# Dislikes: 21
# Total Accepted: 8.4K
# Total Submissions: 23.2K
# Testcase Example: '[2,4,5,8,10]\n[4,6,8,9]'
#
# You are gi... |
efd90861d7b29975d267ad6e5d3c6f3461524dbf | chenxu0602/LeetCode | /777.swap-adjacent-in-lr-string.py | 2,775 | 3.734375 | 4 | #
# @lc app=leetcode id=777 lang=python3
#
# [777] Swap Adjacent in LR String
#
# https://leetcode.com/problems/swap-adjacent-in-lr-string/description/
#
# algorithms
# Medium (34.77%)
# Likes: 407
# Dislikes: 356
# Total Accepted: 28.2K
# Total Submissions: 81K
# Testcase Example: '"X"\n"L"'
#
# In a string com... |
fc9657c26245301c8924a70d22b7626dea252cfc | chenxu0602/LeetCode | /755.pour-water.py | 2,580 | 3.71875 | 4 | #
# @lc app=leetcode id=755 lang=python3
#
# [755] Pour Water
#
# https://leetcode.com/problems/pour-water/description/
#
# algorithms
# Medium (43.31%)
# Likes: 201
# Dislikes: 405
# Total Accepted: 21.4K
# Total Submissions: 49.3K
# Testcase Example: '[2,1,1,2,1,2,2]\n4\n3'
#
#
# We are given an elevation map... |
2869bd563ec54fad8ce89a99aed32c2067830b3d | chenxu0602/LeetCode | /2485.find-the-pivot-integer.py | 419 | 3.578125 | 4 | #
# @lc app=leetcode id=2485 lang=python3
#
# [2485] Find the Pivot Integer
#
# @lc code=start
import math
class Solution:
def pivotInteger(self, n: int) -> int:
# temp = (n * n + n) // 2
# sq = int(math.sqrt(temp))
# if sq * sq == temp:
# return sq
# return -1
... |
dd16bac64e7d51c178ee04a414e6156ee493ab22 | chenxu0602/LeetCode | /897.increasing-order-search-tree.py | 2,202 | 3.8125 | 4 | #
# @lc app=leetcode id=897 lang=python3
#
# [897] Increasing Order Search Tree
#
# https://leetcode.com/problems/increasing-order-search-tree/description/
#
# algorithms
# Easy (70.40%)
# Likes: 771
# Dislikes: 474
# Total Accepted: 73.6K
# Total Submissions: 103.1K
# Testcase Example: '[5,3,6,2,4,null,8,1,null... |
46023fac123bcc142964dfe42b81a5661058e936 | chenxu0602/LeetCode | /1477.find-two-non-overlapping-sub-arrays-each-with-target-sum.py | 2,397 | 3.796875 | 4 | #
# @lc app=leetcode id=1477 lang=python3
#
# [1477] Find Two Non-overlapping Sub-arrays Each With Target Sum
#
# https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/description/
#
# algorithms
# Medium (33.15%)
# Likes: 564
# Dislikes: 28
# Total Accepted: 16.9K
# Total Submiss... |
4348f72ac77b641c876dddd4108ddc587d42b0fa | chenxu0602/LeetCode | /399.evaluate-division.py | 2,569 | 3.796875 | 4 | #
# @lc app=leetcode id=399 lang=python3
#
# [399] Evaluate Division
#
# https://leetcode.com/problems/evaluate-division/description/
#
# algorithms
# Medium (47.61%)
# Likes: 1339
# Dislikes: 105
# Total Accepted: 82.5K
# Total Submissions: 172.7K
# Testcase Example: '[["a","b"],["b","c"]]\n[2.0,3.0]\n' +
#
# E... |
0399cbcd71755c4b22a040d9629390ee054fac7f | chenxu0602/LeetCode | /2652.sum-multiples.py | 326 | 3.53125 | 4 | #
# @lc app=leetcode id=2652 lang=python3
#
# [2652] Sum Multiples
#
# @lc code=start
class Solution:
def sumOfMultiples(self, n: int) -> int:
sum_ = 0
for i in range(1, n + 1):
if i % 3 == 0 or i % 5 == 0 or i % 7 == 0:
sum_ += i
return sum_
# @lc code... |
1cdff7ce1ef4dd78d539cf1308528313ebf8559b | chenxu0602/LeetCode | /1690.stone-game-vii.py | 3,531 | 3.734375 | 4 | #
# @lc app=leetcode id=1690 lang=python3
#
# [1690] Stone Game VII
#
# https://leetcode.com/problems/stone-game-vii/description/
#
# algorithms
# Medium (40.34%)
# Likes: 79
# Dislikes: 51
# Total Accepted: 3.1K
# Total Submissions: 7.6K
# Testcase Example: '[5,3,1,4,2]'
#
# Alice and Bob take turns playing a g... |
70a2233f6f474ecdb4fa1a35bdb9ebed2620a765 | chenxu0602/LeetCode | /360.sort-transformed-array.py | 1,309 | 3.578125 | 4 | #
# @lc app=leetcode id=360 lang=python3
#
# [360] Sort Transformed Array
#
# https://leetcode.com/problems/sort-transformed-array/description/
#
# algorithms
# Medium (46.80%)
# Likes: 228
# Dislikes: 64
# Total Accepted: 27.4K
# Total Submissions: 58.6K
# Testcase Example: '[-4,-2,2,4]\n1\n3\n5'
#
# Given a so... |
c2005b5d7f8b93f724423aa7e0a1b009bb522171 | chenxu0602/LeetCode | /186.reverse-words-in-a-string-ii.py | 1,550 | 3.703125 | 4 | #
# @lc app=leetcode id=186 lang=python3
#
# [186] Reverse Words in a String II
#
# https://leetcode.com/problems/reverse-words-in-a-string-ii/description/
#
# algorithms
# Medium (38.72%)
# Likes: 328
# Dislikes: 87
# Total Accepted: 73.4K
# Total Submissions: 184.5K
# Testcase Example: '["t","h","e"," ","s","k... |
8be070cf3417bac373ef2312fe098c1e572fe542 | chenxu0602/LeetCode | /753.cracking-the-safe.py | 2,367 | 3.703125 | 4 | #
# @lc app=leetcode id=753 lang=python3
#
# [753] Cracking the Safe
#
# https://leetcode.com/problems/cracking-the-safe/description/
#
# algorithms
# Hard (50.39%)
# Likes: 440
# Dislikes: 608
# Total Accepted: 28.5K
# Total Submissions: 56.2K
# Testcase Example: '1\n1'
#
# There is a box protected by a passwor... |
bc2533042eae263de10852a5ceb47e33ed5d97ff | chenxu0602/LeetCode | /59.spiral-matrix-ii.py | 777 | 3.59375 | 4 | #
# @lc app=leetcode id=59 lang=python3
#
# [59] Spiral Matrix II
#
# https://leetcode.com/problems/spiral-matrix-ii/description/
#
# algorithms
# Medium (47.76%)
# Likes: 612
# Dislikes: 90
# Total Accepted: 155.5K
# Total Submissions: 316.6K
# Testcase Example: '3'
#
# Given a positive integer n, generate a sq... |
3ee011482bd2491c8d663b84289b351f8697847b | chenxu0602/LeetCode | /1026.maximum-difference-between-node-and-ancestor.py | 2,229 | 3.71875 | 4 | #
# @lc app=leetcode id=1026 lang=python3
#
# [1026] Maximum Difference Between Node and Ancestor
#
# https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/description/
#
# algorithms
# Medium (62.73%)
# Likes: 317
# Dislikes: 17
# Total Accepted: 21.1K
# Total Submissions: 33.6K
# Testcase E... |
4ba01728b8c0c6f0ee3890fb6cf1ddde4ac2b559 | chenxu0602/LeetCode | /699.falling-squares.py | 3,468 | 3.859375 | 4 | #
# @lc app=leetcode id=699 lang=python3
#
# [699] Falling Squares
#
# https://leetcode.com/problems/falling-squares/description/
#
# algorithms
# Hard (41.69%)
# Likes: 273
# Dislikes: 52
# Total Accepted: 13.6K
# Total Submissions: 32.3K
# Testcase Example: '[[1,2],[2,3],[6,1]]'
#
# On an infinite number line ... |
cd95e8eb4adf374b1ffffd820258215a02acb1ea | chenxu0602/LeetCode | /894.all-possible-full-binary-trees.py | 2,201 | 3.8125 | 4 | #
# @lc app=leetcode id=894 lang=python3
#
# [894] All Possible Full Binary Trees
#
# https://leetcode.com/problems/all-possible-full-binary-trees/description/
#
# algorithms
# Medium (71.60%)
# Likes: 514
# Dislikes: 49
# Total Accepted: 23K
# Total Submissions: 31.9K
# Testcase Example: '7'
#
# A full binary t... |
0105919193618418bfe6cf0c694ecfb6d6ae6ab0 | chenxu0602/LeetCode | /221.maximal-square.py | 1,653 | 3.5625 | 4 | #
# @lc app=leetcode id=221 lang=python3
#
# [221] Maximal Square
#
# https://leetcode.com/problems/maximal-square/description/
#
# algorithms
# Medium (35.27%)
# Likes: 2163
# Dislikes: 54
# Total Accepted: 187.2K
# Total Submissions: 529.3K
# Testcase Example: '[["1","0","1","0","0"],["1","0","1","1","1"],["1"... |
ceb03009b6b4698007e56a61e5da4d61415a9939 | chenxu0602/LeetCode | /387.first-unique-character-in-a-string.py | 847 | 3.59375 | 4 | #
# @lc app=leetcode id=387 lang=python3
#
# [387] First Unique Character in a String
#
# https://leetcode.com/problems/first-unique-character-in-a-string/description/
#
# algorithms
# Easy (50.12%)
# Likes: 1037
# Dislikes: 79
# Total Accepted: 279.1K
# Total Submissions: 555.8K
# Testcase Example: '"leetcode"'... |
cbeb71581063536b629b79bf5096e4505f6f3201 | chenxu0602/LeetCode | /342.power-of-four.py | 834 | 3.578125 | 4 | #
# @lc app=leetcode id=342 lang=python3
#
# [342] Power of Four
#
# https://leetcode.com/problems/power-of-four/description/
#
# algorithms
# Easy (40.29%)
# Likes: 317
# Dislikes: 145
# Total Accepted: 115.3K
# Total Submissions: 285.7K
# Testcase Example: '16'
#
# Given an integer (signed 32 bits), write a fu... |
860f75b6c08f6d2af2b7bf6511d7bf3cd2207494 | chenxu0602/LeetCode | /1827.minimum-operations-to-make-the-array-increasing.py | 1,609 | 3.71875 | 4 | #
# @lc app=leetcode id=1827 lang=python3
#
# [1827] Minimum Operations to Make the Array Increasing
#
# https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing/description/
#
# algorithms
# Easy (79.09%)
# Likes: 35
# Dislikes: 0
# Total Accepted: 5.6K
# Total Submissions: 7K
# Testcase Exa... |
3109beffc6a36ceaeaef534d6d294aadb0ea7da0 | chenxu0602/LeetCode | /1172.dinner-plate-stacks.py | 4,623 | 3.578125 | 4 | #
# @lc app=leetcode id=1172 lang=python3
#
# [1172] Dinner Plate Stacks
#
# https://leetcode.com/problems/dinner-plate-stacks/description/
#
# algorithms
# Hard (39.30%)
# Likes: 91
# Dislikes: 11
# Total Accepted: 4.5K
# Total Submissions: 11.4K
# Testcase Example: '["DinnerPlates","push","push","push","push",... |
3c2be2e61878bdd3bf880d1d7f5befe2c3fd84b0 | chenxu0602/LeetCode | /127.word-ladder.py | 3,140 | 3.671875 | 4 | #
# @lc app=leetcode id=127 lang=python3
#
# [127] Word Ladder
#
# https://leetcode.com/problems/word-ladder/description/
#
# algorithms
# Medium (27.36%)
# Likes: 2371
# Dislikes: 981
# Total Accepted: 354.4K
# Total Submissions: 1.3M
# Testcase Example: '"hit"\n"cog"\n["hot","dot","dog","lot","log","cog"]'
#
#... |
27b93a53885a3d91984aea68fcd0732584c20a8d | chenxu0602/LeetCode | /1383.maximum-performance-of-a-team.py | 2,559 | 3.59375 | 4 | #
# @lc app=leetcode id=1383 lang=python3
#
# [1383] Maximum Performance of a Team
#
# https://leetcode.com/problems/maximum-performance-of-a-team/description/
#
# algorithms
# Hard (33.61%)
# Likes: 296
# Dislikes: 23
# Total Accepted: 8.9K
# Total Submissions: 26.4K
# Testcase Example: '6\n[2,10,3,1,5,8]\n[5,4... |
42fa190c6bba2b16ba8f2ccea613b420c245e9f3 | chenxu0602/LeetCode | /1220.count-vowels-permutation.py | 2,165 | 3.6875 | 4 | #
# @lc app=leetcode id=1220 lang=python3
#
# [1220] Count Vowels Permutation
#
# https://leetcode.com/problems/count-vowels-permutation/description/
#
# algorithms
# Hard (53.70%)
# Likes: 206
# Dislikes: 44
# Total Accepted: 11.7K
# Total Submissions: 21.7K
# Testcase Example: '1'
#
# Given an integer n, your ... |
0b57475ba151624d8ae38f959f659debeaf8b9a7 | chenxu0602/LeetCode | /906.super-palindromes.py | 2,710 | 3.796875 | 4 | #
# @lc app=leetcode id=906 lang=python3
#
# [906] Super Palindromes
#
# https://leetcode.com/problems/super-palindromes/description/
#
# algorithms
# Hard (30.67%)
# Likes: 53
# Dislikes: 137
# Total Accepted: 3.9K
# Total Submissions: 12.6K
# Testcase Example: '"4"\n"1000"'
#
# Let's say a positive integer is ... |
f1be705117d098a341c805cf82ed3a530d038afe | chenxu0602/LeetCode | /1095.find-in-mountain-array.py | 2,844 | 3.671875 | 4 | #
# @lc app=leetcode id=1095 lang=python3
#
# [1095] Find in Mountain Array
#
# https://leetcode.com/problems/find-in-mountain-array/description/
#
# algorithms
# Hard (35.79%)
# Likes: 348
# Dislikes: 28
# Total Accepted: 17.6K
# Total Submissions: 48.8K
# Testcase Example: '[1,2,3,4,5,3,1]\n3'
#
# (This proble... |
c6472f70e57a2bbb6d9dcd68d4a5203457241e40 | chenxu0602/LeetCode | /10.regular-expression-matching.py | 2,371 | 3.90625 | 4 | #
# @lc app=leetcode id=10 lang=python3
#
# [10] Regular Expression Matching
#
# https://leetcode.com/problems/regular-expression-matching/description/
#
# algorithms
# Hard (26.14%)
# Likes: 3538
# Dislikes: 626
# Total Accepted: 382.5K
# Total Submissions: 1.5M
# Testcase Example: '"aa"\n"a"'
#
# Given an inpu... |
03009f0807f8498bb918c97bf7d10eeb8c904fca | chenxu0602/LeetCode | /1120.maximum-average-subtree.py | 1,784 | 3.734375 | 4 | #
# @lc app=leetcode id=1120 lang=python3
#
# [1120] Maximum Average Subtree
#
# https://leetcode.com/problems/maximum-average-subtree/description/
#
# algorithms
# Medium (62.12%)
# Likes: 267
# Dislikes: 9
# Total Accepted: 18.2K
# Total Submissions: 28.9K
# Testcase Example: '[5,6,1]'
#
# Given the root of a ... |
01ae31f4a117b59274880b735aaa6875a4154e18 | chenxu0602/LeetCode | /745.prefix-and-suffix-search.py | 2,934 | 3.84375 | 4 | #
# @lc app=leetcode id=745 lang=python3
#
# [745] Prefix and Suffix Search
#
# https://leetcode.com/problems/prefix-and-suffix-search/description/
#
# algorithms
# Hard (32.98%)
# Likes: 269
# Dislikes: 181
# Total Accepted: 16.2K
# Total Submissions: 49.2K
# Testcase Example: '["WordFilter","f"]\n[[["apple"]],... |
1b1acab7fc2a4cca185aad3f3ba58f2ac5348d96 | chenxu0602/LeetCode | /843.guess-the-word.py | 4,815 | 3.953125 | 4 | #
# @lc app=leetcode id=843 lang=python3
#
# [843] Guess the Word
#
# https://leetcode.com/problems/guess-the-word/description/
#
# algorithms
# Hard (44.43%)
# Likes: 322
# Dislikes: 346
# Total Accepted: 25.8K
# Total Submissions: 57.9K
# Testcase Example: '"acckzz"\n["acckzz","ccbazz","eiowzz","abcczz"]\n10'
... |
e94731b04666aabbacdd906ae8fdb7c32a31f55e | chenxu0602/LeetCode | /969.pancake-sorting.py | 2,363 | 3.90625 | 4 | #
# @lc app=leetcode id=969 lang=python3
#
# [969] Pancake Sorting
#
# https://leetcode.com/problems/pancake-sorting/description/
#
# algorithms
# Medium (64.64%)
# Likes: 275
# Dislikes: 345
# Total Accepted: 21.2K
# Total Submissions: 32.8K
# Testcase Example: '[3,2,4,1]'
#
# Given an array A, we can perform a... |
5b83444aeb38ed9bb88be9a76756d65339999034 | chenxu0602/LeetCode | /1812.determine-color-of-a-chessboard-square.py | 1,456 | 4.0625 | 4 | #
# @lc app=leetcode id=1812 lang=python3
#
# [1812] Determine Color of a Chessboard Square
#
# https://leetcode.com/problems/determine-color-of-a-chessboard-square/description/
#
# algorithms
# Easy (75.32%)
# Likes: 18
# Dislikes: 0
# Total Accepted: 3.9K
# Total Submissions: 5.2K
# Testcase Example: '"a1"'
#
... |
8f56f9ac5ab99a650db2900a928e98bc0568cee8 | chenxu0602/LeetCode | /369.plus-one-linked-list.py | 1,972 | 3.765625 | 4 | #
# @lc app=leetcode id=369 lang=python3
#
# [369] Plus One Linked List
#
# https://leetcode.com/problems/plus-one-linked-list/description/
#
# algorithms
# Medium (58.16%)
# Likes: 458
# Dislikes: 30
# Total Accepted: 47K
# Total Submissions: 80.7K
# Testcase Example: '[1,2,3]'
#
# Given a non-negative integer ... |
a0827333ac126523071e71024f089bef24f485ac | chenxu0602/LeetCode | /119.pascals-triangle-ii.py | 949 | 3.75 | 4 | #
# @lc app=leetcode id=119 lang=python3
#
# [119] Pascal's Triangle II
#
# https://leetcode.com/problems/pascals-triangle-ii/description/
#
# algorithms
# Easy (48.78%)
# Likes: 846
# Dislikes: 197
# Total Accepted: 287.6K
# Total Submissions: 588.4K
# Testcase Example: '3'
#
# Given a non-negative index k wher... |
e97ebfa0f7f299c6f65586944e7e66469a0cbcef | chenxu0602/LeetCode | /1161.maximum-level-sum-of-a-binary-tree.py | 2,277 | 3.703125 | 4 | #
# @lc app=leetcode id=1161 lang=python3
#
# [1161] Maximum Level Sum of a Binary Tree
#
# https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/description/
#
# algorithms
# Medium (72.27%)
# Likes: 547
# Dislikes: 26
# Total Accepted: 51.2K
# Total Submissions: 71.2K
# Testcase Example: '[1,7,0,7,-... |
76e926a815c12c242a14c072ab57b7988620ccbf | chenxu0602/LeetCode | /419.battleships-in-a-board.py | 1,690 | 3.796875 | 4 | #
# @lc app=leetcode id=419 lang=python3
#
# [419] Battleships in a Board
#
# https://leetcode.com/problems/battleships-in-a-board/description/
#
# algorithms
# Medium (65.89%)
# Likes: 436
# Dislikes: 340
# Total Accepted: 63.7K
# Total Submissions: 96.7K
# Testcase Example: '[["X",".",".","X"],[".",".",".","X"... |
bec065c16ea5d1401fefb9793a95b0371cb231aa | chenxu0602/LeetCode | /1399.count-largest-group.py | 1,291 | 3.65625 | 4 | #
# @lc app=leetcode id=1399 lang=python3
#
# [1399] Count Largest Group
#
# https://leetcode.com/problems/count-largest-group/description/
#
# algorithms
# Easy (65.16%)
# Likes: 136
# Dislikes: 321
# Total Accepted: 17.7K
# Total Submissions: 27.1K
# Testcase Example: '13\r'
#
# Given an integer n. Each number... |
96ecf109aa2d6cef167c2ce1eac4a6462edd413a | chenxu0602/LeetCode | /653.two-sum-iv-input-is-a-bst.py | 1,455 | 3.734375 | 4 | #
# @lc app=leetcode id=653 lang=python3
#
# [653] Two Sum IV - Input is a BST
#
# https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/
#
# algorithms
# Easy (55.38%)
# Likes: 1554
# Dislikes: 141
# Total Accepted: 152.4K
# Total Submissions: 274.1K
# Testcase Example: '[5,3,6,2,4,null,7]\n9'
#
#... |
2aaab285a099c000f7d3493bab6dedb2910e697a | chenxu0602/LeetCode | /1400.construct-k-palindrome-strings.py | 1,802 | 3.703125 | 4 | #
# @lc app=leetcode id=1400 lang=python3
#
# [1400] Construct K Palindrome Strings
#
# https://leetcode.com/problems/construct-k-palindrome-strings/description/
#
# algorithms
# Medium (61.44%)
# Likes: 240
# Dislikes: 25
# Total Accepted: 14K
# Total Submissions: 22.3K
# Testcase Example: '"annabelle"\n2'
#
# ... |
f4becba8943ba1af17348576f79e981a79e72a62 | chenxu0602/LeetCode | /1560.most-visited-sector-in-a-circular-track.py | 2,033 | 3.625 | 4 | #
# @lc app=leetcode id=1560 lang=python3
#
# [1560] Most Visited Sector in a Circular Track
#
# https://leetcode.com/problems/most-visited-sector-in-a-circular-track/description/
#
# algorithms
# Easy (56.98%)
# Likes: 98
# Dislikes: 234
# Total Accepted: 12.6K
# Total Submissions: 22.1K
# Testcase Example: '4... |
045262b4b94b9cb51bd2979ddac8ca1e042edd54 | chenxu0602/LeetCode | /524.longest-word-in-dictionary-through-deleting.py | 1,820 | 3.640625 | 4 | #
# @lc app=leetcode id=524 lang=python3
#
# [524] Longest Word in Dictionary through Deleting
#
# https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/description/
#
# algorithms
# Medium (46.10%)
# Likes: 348
# Dislikes: 183
# Total Accepted: 46.3K
# Total Submissions: 100.2K
# Testcase Exa... |
307c905c7c9973e6f16442eb2c75d386f89e0cea | chenxu0602/LeetCode | /274.h-index.py | 1,857 | 3.984375 | 4 | #
# @lc app=leetcode id=274 lang=python3
#
# [274] H-Index
#
# https://leetcode.com/problems/h-index/description/
#
# algorithms
# Medium (35.17%)
# Likes: 515
# Dislikes: 866
# Total Accepted: 141K
# Total Submissions: 400.8K
# Testcase Example: '[3,0,6,1,5]'
#
# Given an array of citations (each citation is a ... |
ddc11fec2d7c3a9422c2340889f84160b1979456 | chenxu0602/LeetCode | /1814.count-nice-pairs-in-an-array.py | 1,702 | 3.515625 | 4 | #
# @lc app=leetcode id=1814 lang=python3
#
# [1814] Count Nice Pairs in an Array
#
# https://leetcode.com/problems/count-nice-pairs-in-an-array/description/
#
# algorithms
# Medium (28.37%)
# Likes: 46
# Dislikes: 10
# Total Accepted: 2.2K
# Total Submissions: 7.5K
# Testcase Example: '[42,11,1,97]'
#
# You are... |
72296b0fd11aaef084f4993e190da09428028bc9 | chenxu0602/LeetCode | /1210.minimum-moves-to-reach-target-with-rotations.py | 3,127 | 3.71875 | 4 | #
# @lc app=leetcode id=1210 lang=python3
#
# [1210] Minimum Moves to Reach Target with Rotations
#
# https://leetcode.com/problems/minimum-moves-to-reach-target-with-rotations/description/
#
# algorithms
# Hard (43.97%)
# Likes: 81
# Dislikes: 28
# Total Accepted: 3.8K
# Total Submissions: 8.6K
# Testcase Exampl... |
9257796a0ba25158eef89c2c3569f134c11b50f3 | chenxu0602/LeetCode | /1540.can-convert-string-in-k-moves.py | 2,371 | 3.546875 | 4 | #
# @lc app=leetcode id=1540 lang=python3
#
# [1540] Can Convert String in K Moves
#
# https://leetcode.com/problems/can-convert-string-in-k-moves/description/
#
# algorithms
# Medium (30.00%)
# Likes: 162
# Dislikes: 134
# Total Accepted: 8.3K
# Total Submissions: 27.7K
# Testcase Example: '"input"\n"ouput"\n9'... |
1ce79b39877939c19ddbfebe617e940d535bb4c1 | chenxu0602/LeetCode | /309.best-time-to-buy-and-sell-stock-with-cooldown.py | 1,575 | 3.75 | 4 | #
# @lc app=leetcode id=309 lang=python3
#
# [309] Best Time to Buy and Sell Stock with Cooldown
#
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/description/
#
# algorithms
# Medium (45.52%)
# Likes: 1885
# Dislikes: 73
# Total Accepted: 119.3K
# Total Submissions: 262K
# Testcase ... |
b55211cb222af2a1d8fa44f809e3743f11bceb11 | chenxu0602/LeetCode | /1340.jump-game-v.py | 4,482 | 3.59375 | 4 | #
# @lc app=leetcode id=1340 lang=python3
#
# [1340] Jump Game V
#
# https://leetcode.com/problems/jump-game-v/description/
#
# algorithms
# Hard (58.24%)
# Likes: 263
# Dislikes: 13
# Total Accepted: 9.8K
# Total Submissions: 16.8K
# Testcase Example: '[6,4,14,6,8,13,9,7,10,6,12]\n2'
#
# Given an array of integ... |
148c3a0f42a1edc9469b9167354f08cc830a08f3 | chenxu0602/LeetCode | /1296.divide-array-in-sets-of-k-consecutive-numbers.py | 1,772 | 3.5 | 4 | #
# @lc app=leetcode id=1296 lang=python3
#
# [1296] Divide Array in Sets of K Consecutive Numbers
#
# https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/description/
#
# algorithms
# Medium (48.09%)
# Likes: 135
# Dislikes: 10
# Total Accepted: 8.8K
# Total Submissions: 18.3K
# Testcase ... |
39ae6b3aaf6fedb28bb902a73aef9ff859621e66 | chenxu0602/LeetCode | /862.shortest-subarray-with-sum-at-least-k.py | 1,451 | 3.53125 | 4 | #
# @lc app=leetcode id=862 lang=python3
#
# [862] Shortest Subarray with Sum at Least K
#
# https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/description/
#
# algorithms
# Hard (23.20%)
# Likes: 765
# Dislikes: 23
# Total Accepted: 21.9K
# Total Submissions: 94.6K
# Testcase Example: '[1]\n1'
... |
8087953f81a6f59e001f902690e929cd47363919 | chenxu0602/LeetCode | /1036.escape-a-large-maze.py | 2,892 | 3.65625 | 4 | #
# @lc app=leetcode id=1036 lang=python3
#
# [1036] Escape a Large Maze
#
# https://leetcode.com/problems/escape-a-large-maze/description/
#
# algorithms
# Hard (35.40%)
# Likes: 241
# Dislikes: 101
# Total Accepted: 10.5K
# Total Submissions: 29.7K
# Testcase Example: '[[0,1],[1,0]]\n[0,0]\n[0,2]'
#
# In a 1 m... |
27e7182764a066bd5ff3d5fb0330f3efee1360e3 | chenxu0602/LeetCode | /903.valid-permutations-for-di-sequence.py | 3,842 | 3.59375 | 4 | #
# @lc app=leetcode id=903 lang=python3
#
# [903] Valid Permutations for DI Sequence
#
# https://leetcode.com/problems/valid-permutations-for-di-sequence/description/
#
# algorithms
# Hard (49.50%)
# Likes: 300
# Dislikes: 28
# Total Accepted: 6.1K
# Total Submissions: 12.1K
# Testcase Example: '"DID"'
#
# We a... |
816eab77c4c40b65f40f6687885101abffcc6ca0 | chenxu0602/LeetCode | /1466.reorder-routes-to-make-all-paths-lead-to-the-city-zero.py | 2,685 | 4.03125 | 4 | #
# @lc app=leetcode id=1466 lang=python3
#
# [1466] Reorder Routes to Make All Paths Lead to the City Zero
#
# https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/description/
#
# algorithms
# Medium (61.65%)
# Likes: 458
# Dislikes: 11
# Total Accepted: 20.1K
# Total Submissions... |
2134ff797134585d45133bff0d381d3a150ee3e3 | chenxu0602/LeetCode | /1759.count-number-of-homogenous-substrings.py | 1,482 | 3.828125 | 4 | #
# @lc app=leetcode id=1759 lang=python3
#
# [1759] Count Number of Homogenous Substrings
#
# https://leetcode.com/problems/count-number-of-homogenous-substrings/description/
#
# algorithms
# Medium (41.21%)
# Likes: 106
# Dislikes: 15
# Total Accepted: 7.9K
# Total Submissions: 19.2K
# Testcase Example: '"abbc... |
821c3c45ac5cfb1854e6dfac179fbbe9c9316477 | chenxu0602/LeetCode | /1834.single-threaded-cpu.py | 3,750 | 3.84375 | 4 | #
# @lc app=leetcode id=1834 lang=python3
#
# [1834] Single-Threaded CPU
#
# https://leetcode.com/problems/single-threaded-cpu/description/
#
# algorithms
# Medium (22.59%)
# Likes: 151
# Dislikes: 52
# Total Accepted: 4.9K
# Total Submissions: 16.1K
# Testcase Example: '[[1,2],[2,4],[3,2],[4,1]]'
#
# You are gi... |
cfc422cf788f350da2b284f6f097a7800e7f286c | chenxu0602/LeetCode | /1799.maximize-score-after-n-operations.py | 2,564 | 3.734375 | 4 | #
# @lc app=leetcode id=1799 lang=python3
#
# [1799] Maximize Score After N Operations
#
# https://leetcode.com/problems/maximize-score-after-n-operations/description/
#
# algorithms
# Hard (52.06%)
# Likes: 117
# Dislikes: 7
# Total Accepted: 3.6K
# Total Submissions: 6.8K
# Testcase Example: '[1,2]'
#
# You ar... |
3d7d09e83ec6e991107859a06e1157e17f424917 | chenxu0602/LeetCode | /1801.number-of-orders-in-the-backlog.py | 4,875 | 3.78125 | 4 | #
# @lc app=leetcode id=1801 lang=python3
#
# [1801] Number of Orders in the Backlog
#
# https://leetcode.com/problems/number-of-orders-in-the-backlog/description/
#
# algorithms
# Medium (43.63%)
# Likes: 82
# Dislikes: 112
# Total Accepted: 5.3K
# Total Submissions: 12.2K
# Testcase Example: '[[10,5,0],[15,2,1... |
7b21476c55550876f806e52780a46c8ad81b2470 | chenxu0602/LeetCode | /345.reverse-vowels-of-a-string.py | 1,270 | 3.828125 | 4 | #
# @lc app=leetcode id=345 lang=python3
#
# [345] Reverse Vowels of a String
#
# https://leetcode.com/problems/reverse-vowels-of-a-string/description/
#
# algorithms
# Easy (41.53%)
# Likes: 389
# Dislikes: 722
# Total Accepted: 158.6K
# Total Submissions: 381.2K
# Testcase Example: '"hello"'
#
# Write a functi... |
e2422cfbe5d2daba5f2c28688b6e0cfc19ac6296 | chenxu0602/LeetCode | /842.split-array-into-fibonacci-sequence.py | 2,518 | 3.546875 | 4 | #
# @lc app=leetcode id=842 lang=python3
#
# [842] Split Array into Fibonacci Sequence
#
# https://leetcode.com/problems/split-array-into-fibonacci-sequence/description/
#
# algorithms
# Medium (36.29%)
# Likes: 485
# Dislikes: 169
# Total Accepted: 20.7K
# Total Submissions: 57K
# Testcase Example: '"123456579"... |
e687b62aa8be021bee2b4a25dd67154dfdc22c80 | chenxu0602/LeetCode | /1528.shuffle-string.py | 1,558 | 3.734375 | 4 | #
# @lc app=leetcode id=1528 lang=python3
#
# [1528] Shuffle String
#
# https://leetcode.com/problems/shuffle-string/description/
#
# algorithms
# Easy (85.80%)
# Likes: 326
# Dislikes: 69
# Total Accepted: 65.6K
# Total Submissions: 76.4K
# Testcase Example: '"codeleet"\n[4,5,6,7,0,2,1,3]'
#
# Given a string s ... |
d70e45c3b9788dd02bcec3678851e70a99ba73d0 | chenxu0602/LeetCode | /100.same-tree.py | 1,957 | 3.9375 | 4 | #
# @lc app=leetcode id=100 lang=python3
#
# [100] Same Tree
#
# https://leetcode.com/problems/same-tree/description/
#
# algorithms
# Easy (50.51%)
# Likes: 1352
# Dislikes: 45
# Total Accepted: 429.3K
# Total Submissions: 842.5K
# Testcase Example: '[1,2,3]\n[1,2,3]'
#
# Given two binary trees, write a functio... |
e6ad43746672aec377138ae781d51547da8522cd | chenxu0602/LeetCode | /931.minimum-falling-path-sum.py | 1,490 | 3.609375 | 4 | #
# @lc app=leetcode id=931 lang=python3
#
# [931] Minimum Falling Path Sum
#
# https://leetcode.com/problems/minimum-falling-path-sum/description/
#
# algorithms
# Medium (60.73%)
# Likes: 570
# Dislikes: 50
# Total Accepted: 41.3K
# Total Submissions: 67.1K
# Testcase Example: '[[1,2,3],[4,5,6],[7,8,9]]'
#
# G... |
2db72fd644567ae5648d18bb60b1c5129cc7799f | chenxu0602/LeetCode | /685.redundant-connection-ii.py | 3,298 | 3.671875 | 4 | #
# @lc app=leetcode id=685 lang=python3
#
# [685] Redundant Connection II
#
# https://leetcode.com/problems/redundant-connection-ii/description/
#
# algorithms
# Hard (30.92%)
# Likes: 488
# Dislikes: 159
# Total Accepted: 24.4K
# Total Submissions: 78.6K
# Testcase Example: '[[1,2],[1,3],[2,3]]'
#
#
# In this... |
92765094fbd3f03387234079a0e95ca0b612b037 | chenxu0602/LeetCode | /1544.make-the-string-great.py | 1,832 | 3.671875 | 4 | #
# @lc app=leetcode id=1544 lang=python3
#
# [1544] Make The String Great
#
# https://leetcode.com/problems/make-the-string-great/description/
#
# algorithms
# Easy (54.73%)
# Likes: 251
# Dislikes: 27
# Total Accepted: 22.3K
# Total Submissions: 40.8K
# Testcase Example: '"leEeetcode"'
#
# Given a string s of ... |
656dc1f52e48f0682d11775bd3dd869f0ba5b184 | chenxu0602/LeetCode | /1240.tiling-a-rectangle-with-the-fewest-squares.py | 1,405 | 3.921875 | 4 | #
# @lc app=leetcode id=1240 lang=python3
#
# [1240] Tiling a Rectangle with the Fewest Squares
#
# https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/description/
#
# algorithms
# Hard (49.07%)
# Likes: 81
# Dislikes: 133
# Total Accepted: 3K
# Total Submissions: 6.1K
# Testcase Example: '... |
303fe1cd48ffcbe993c138d2ac1946694e23683d | chenxu0602/LeetCode | /420.strong-password-checker.py | 2,138 | 3.671875 | 4 | #
# @lc app=leetcode id=420 lang=python3
#
# [420] Strong Password Checker
#
# https://leetcode.com/problems/strong-password-checker/description/
#
# algorithms
# Hard (17.16%)
# Likes: 89
# Dislikes: 373
# Total Accepted: 6.5K
# Total Submissions: 38.1K
# Testcase Example: '""'
#
# A password is considered stro... |
96e2e4a796a78cc7abc87e9d674d4d252c2caae8 | chenxu0602/LeetCode | /866.prime-palindrome.py | 1,582 | 3.890625 | 4 | #
# @lc app=leetcode id=866 lang=python3
#
# [866] Prime Palindrome
#
# https://leetcode.com/problems/prime-palindrome/description/
#
# algorithms
# Medium (24.81%)
# Likes: 205
# Dislikes: 567
# Total Accepted: 19.3K
# Total Submissions: 77.2K
# Testcase Example: '6'
#
# Find the smallest prime palindrome great... |
248fd46e5e8d2f881dd99a3bbc9bcf3729936b6d | chenxu0602/LeetCode | /307.range-sum-query-mutable.py | 2,501 | 3.609375 | 4 | #
# @lc app=leetcode id=307 lang=python3
#
# [307] Range Sum Query - Mutable
#
# https://leetcode.com/problems/range-sum-query-mutable/description/
#
# algorithms
# Medium (32.10%)
# Likes: 1031
# Dislikes: 71
# Total Accepted: 92.8K
# Total Submissions: 288.5K
# Testcase Example: '["NumArray","sumRange","update... |
efe7909441a99eb1cdf3c7e921894ba479fc0f80 | chenxu0602/LeetCode | /926.flip-string-to-monotone-increasing.py | 1,580 | 3.765625 | 4 | #
# @lc app=leetcode id=926 lang=python3
#
# [926] Flip String to Monotone Increasing
#
# https://leetcode.com/problems/flip-string-to-monotone-increasing/description/
#
# algorithms
# Medium (50.30%)
# Likes: 375
# Dislikes: 13
# Total Accepted: 14.8K
# Total Submissions: 29.3K
# Testcase Example: '"00110"'
#
#... |
4ac441a33c5905a6c85bc67b4facab7aa08b9068 | chenxu0602/LeetCode | /264.ugly-number-ii.py | 1,212 | 3.78125 | 4 | #
# @lc app=leetcode id=264 lang=python3
#
# [264] Ugly Number II
#
# https://leetcode.com/problems/ugly-number-ii/description/
#
# algorithms
# Medium (41.93%)
# Likes: 1974
# Dislikes: 122
# Total Accepted: 179.8K
# Total Submissions: 428.3K
# Testcase Example: '10'
#
# Write a program to find the n-th ugly nu... |
426d4c7a975021758e587afa59c688973c5224e9 | chenxu0602/LeetCode | /801.minimum-swaps-to-make-sequences-increasing.py | 2,098 | 3.828125 | 4 | #
# @lc app=leetcode id=801 lang=python3
#
# [801] Minimum Swaps To Make Sequences Increasing
#
# https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/description/
#
# algorithms
# Medium (37.91%)
# Likes: 818
# Dislikes: 60
# Total Accepted: 25.2K
# Total Submissions: 66.4K
# Testcase Example... |
a53dd5cf4c2bc18f48e9f4b2a71e6eb14aff46c5 | chenxu0602/LeetCode | /132.palindrome-partitioning-ii.py | 2,247 | 3.625 | 4 | #
# @lc app=leetcode id=132 lang=python3
#
# [132] Palindrome Partitioning II
#
# https://leetcode.com/problems/palindrome-partitioning-ii/description/
#
# algorithms
# Hard (28.04%)
# Likes: 727
# Dislikes: 25
# Total Accepted: 112.9K
# Total Submissions: 396.2K
# Testcase Example: '"aab"'
#
# Given a string s,... |
5f66c6940058dc5aeae9ef5697a92516719b3802 | chenxu0602/LeetCode | /302.smallest-rectangle-enclosing-black-pixels.py | 1,748 | 3.703125 | 4 | #
# @lc app=leetcode id=302 lang=python3
#
# [302] Smallest Rectangle Enclosing Black Pixels
#
# https://leetcode.com/problems/smallest-rectangle-enclosing-black-pixels/description/
#
# algorithms
# Hard (51.53%)
# Likes: 204
# Dislikes: 51
# Total Accepted: 28K
# Total Submissions: 54.2K
# Testcase Example: '[[... |
ff5328134424c8456534140170555d375615e2e2 | chenxu0602/LeetCode | /792.number-of-matching-subsequences.py | 2,537 | 3.703125 | 4 | #
# @lc app=leetcode id=792 lang=python3
#
# [792] Number of Matching Subsequences
#
# https://leetcode.com/problems/number-of-matching-subsequences/description/
#
# algorithms
# Medium (44.20%)
# Likes: 536
# Dislikes: 42
# Total Accepted: 24.2K
# Total Submissions: 54.5K
# Testcase Example: '"abcde"\n["a","bb"... |
ae2b17cb18c2eeb0ef8593aece9a85d7f93ab92e | chenxu0602/LeetCode | /93.restore-ip-addresses.py | 1,096 | 3.5 | 4 | #
# @lc app=leetcode id=93 lang=python3
#
# [93] Restore IP Addresses
#
# https://leetcode.com/problems/restore-ip-addresses/description/
#
# algorithms
# Medium (33.64%)
# Likes: 970
# Dislikes: 436
# Total Accepted: 170.9K
# Total Submissions: 506.5K
# Testcase Example: '"25525511135"'
#
# Given a string conta... |
132c62986b5ad8c098dae64c5bc5ec7a2d263fde | chenxu0602/LeetCode | /654.maximum-binary-tree.py | 2,208 | 3.765625 | 4 | #
# @lc app=leetcode id=654 lang=python3
#
# [654] Maximum Binary Tree
#
# https://leetcode.com/problems/maximum-binary-tree/description/
#
# algorithms
# Medium (76.56%)
# Likes: 1174
# Dislikes: 145
# Total Accepted: 91.6K
# Total Submissions: 119.4K
# Testcase Example: '[3,2,1,6,0,5]'
#
#
# Given an integer ... |
ccfed4fddb7963af6917b89ce8e7b183516a084c | chenxu0602/LeetCode | /2181.merge-nodes-in-between-zeros.py | 704 | 3.796875 | 4 | #
# @lc app=leetcode id=2181 lang=python3
#
# [2181] Merge Nodes in Between Zeros
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeNodes(self, head: Optional[ListNode]) ... |
49a40b424b213e59331a485e59713dc229a0a562 | chenxu0602/LeetCode | /298.binary-tree-longest-consecutive-sequence.py | 2,435 | 3.703125 | 4 | #
# @lc app=leetcode id=298 lang=python3
#
# [298] Binary Tree Longest Consecutive Sequence
#
# https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/description/
#
# algorithms
# Medium (44.07%)
# Likes: 308
# Dislikes: 76
# Total Accepted: 61.6K
# Total Submissions: 139.7K
# Testcase Example: ... |
24916fbd1515026fa850b7960facfb1ebc2f28de | chenxu0602/LeetCode | /1329.sort-the-matrix-diagonally.py | 1,228 | 4 | 4 | #
# @lc app=leetcode id=1329 lang=python3
#
# [1329] Sort the Matrix Diagonally
#
# https://leetcode.com/problems/sort-the-matrix-diagonally/description/
#
# algorithms
# Medium (79.07%)
# Likes: 471
# Dislikes: 115
# Total Accepted: 23.4K
# Total Submissions: 29.6K
# Testcase Example: '[[3,3,1,1],[2,2,1,2],[1,1... |
8ebbc0c4fa7852a06267f53e7fd18a0f8541a9ce | chenxu0602/LeetCode | /951.flip-equivalent-binary-trees.py | 3,144 | 3.796875 | 4 | #
# @lc app=leetcode id=951 lang=python3
#
# [951] Flip Equivalent Binary Trees
#
# https://leetcode.com/problems/flip-equivalent-binary-trees/description/
#
# algorithms
# Medium (65.75%)
# Likes: 754
# Dislikes: 40
# Total Accepted: 56.3K
# Total Submissions: 86.1K
# Testcase Example: '[1,2,3,4,5,6,null,null,n... |
1566591c58f3aee5ad015a26f8dee0218524beeb | chenxu0602/LeetCode | /282.expression-add-operators.py | 1,853 | 3.90625 | 4 | #
# @lc app=leetcode id=282 lang=python3
#
# [282] Expression Add Operators
#
# https://leetcode.com/problems/expression-add-operators/description/
#
# algorithms
# Hard (34.57%)
# Likes: 959
# Dislikes: 150
# Total Accepted: 87.4K
# Total Submissions: 252.7K
# Testcase Example: '"123"\n6'
#
# Given a string tha... |
1fcf6492ae66de457e9fe14456fb1a8f3dd85edc | chenxu0602/LeetCode | /2663.lexicographically-smallest-beautiful-string.py | 1,499 | 3.515625 | 4 | #
# @lc app=leetcode id=2663 lang=python3
#
# [2663] Lexicographically Smallest Beautiful String
#
# @lc code=start
class Solution:
def smallestBeautifulString(self, s: str, k: int) -> str:
A = [ord(c) - ord('a') for c in s]
n = len(A)
i = n - 1
A[i] += 1
while i >= 0:
... |
75f075842f53efa80bfdacd7481d895a2c969077 | chenxu0602/LeetCode | /790.domino-and-tromino-tiling.py | 2,368 | 3.796875 | 4 | #
# @lc app=leetcode id=790 lang=python3
#
# [790] Domino and Tromino Tiling
#
# https://leetcode.com/problems/domino-and-tromino-tiling/description/
#
# algorithms
# Medium (39.09%)
# Likes: 426
# Dislikes: 231
# Total Accepted: 15.6K
# Total Submissions: 39.7K
# Testcase Example: '3'
#
# We have two types of t... |
afd76acd38cc16ae706336528139ea29f1f923b1 | chenxu0602/LeetCode | /466.count-the-repetitions.py | 2,916 | 3.546875 | 4 | #
# @lc app=leetcode id=466 lang=python3
#
# [466] Count The Repetitions
#
# https://leetcode.com/problems/count-the-repetitions/description/
#
# algorithms
# Hard (27.85%)
# Likes: 146
# Dislikes: 117
# Total Accepted: 9.5K
# Total Submissions: 34K
# Testcase Example: '"acb"\n4\n"ab"\n2'
#
# Define S = [s,n] as... |
93fbc44ca6a617af84ba229830f7edff91be140e | chenxu0602/LeetCode | /170.two-sum-iii-data-structure-design.py | 1,591 | 3.859375 | 4 | #
# @lc app=leetcode id=170 lang=python3
#
# [170] Two Sum III - Data structure design
#
# https://leetcode.com/problems/two-sum-iii-data-structure-design/description/
#
# algorithms
# Easy (31.14%)
# Likes: 218
# Dislikes: 185
# Total Accepted: 67.1K
# Total Submissions: 211.2K
# Testcase Example: '["TwoSum","a... |
e82b0fd03d6e5b672a8cfe540431b3a52e73ad8d | chenxu0602/LeetCode | /490.the-maze.py | 3,792 | 3.828125 | 4 | #
# @lc app=leetcode id=490 lang=python3
#
# [490] The Maze
#
# https://leetcode.com/problems/the-maze/description/
#
# algorithms
# Medium (50.07%)
# Likes: 597
# Dislikes: 63
# Total Accepted: 52.2K
# Total Submissions: 104.3K
# Testcase Example: '[[0,0,1,0,0],[0,0,0,0,0],[0,0,0,1,0],[1,1,0,1,1],[0,0,0,0,0]]\n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.