Python Solutions of LeetCode Problems. Daily Update. If you like this, please leave me a star. ★ :octocat:
Last updated Jun 8, 2026
86
Stars
31
Forks
1
Issues
0
Stars/day
Attention Score
14
Language breakdown
Python 100.0%
▸ Files
click to expand
README
Python solutions of LeetCode problems.
Project on summer pause :)
Introduction
In this repository provided my Python solutions of LeetCode problems.- I highly recommend you to try and solve problems yourself before look at the solutions here.
- Solutions and approaches may be not optimal (I'm learning and practicing DSA & committing my solutions).
- All Solutions here are in Python 3.
LeetCoding Challenges
2020:
- April LeetCoding Challenge - 28/30
- August LeetCoding Challenge - 31/31
- September LeetCoding Challenge - 30/30
- November LeetCoding Challenge - 24/30
- December LeetCoding Challenge - 27/31
- January LeetCoding Challenge - 27/31
- February LeetCoding Challenge - 23/28
- March LeetCoding Challenge - 23/31
- April LeetCoding Challenge - 23/30
- May LeetCoding Challenge - 17/31
- June LeetCoding Challenge - 10/30
Solutions
P.S. If you like this, please leave me a star. ★ |№|Title|Solution|Difficulty|Note| | ---: | --- | --- | --- | --- | |1.|Two Sum|Python|Easy| |1.|Two Sum|Python.py)|Easy|optimized soln| |2.|Add Two Numbers|Python|Medium|Linked List + brute force| |3.|Longest Substring Without Repeating Characters|Python|Medium|Kinda brute force| |4.|Median of Two Sorted Arrays|Python|Hard| |5.|Longest Palindromic Substring|Python.py)|Medium|Brute Force| |7.|Reverse Integer|Python|Easy| |9.|Palindrome Number|Python|Easy|Without converting integer into string| |11.|Container With Most Water|Python|Medium|Two Pointers| |12.|Integer to Roman|Python|Medium|| |13.|Roman to Integer|Python|Easy|| |14.|Longest Common Prefix|Python|Easy|| |15.|3Sum|Python.py)|Medium|Brute Force| |16.|3Sum Closest|Python.py)|Medium|Brute Force| |17.|Letter Combinations of a Phone Number|Python|Medium|DFS, Recursion| |19.|Remove Nth Node From End of List|Python|Medium|Stack| |20.|Valid Parentheses|Python.py)|Easy|Brute Force| |20.|Valid Parentheses|Python.py)|Easy|Stack| |21.|Merge Two Sorted Lists|Python|Easy|Linked List| |23.|Merge k Sorted Lists|Python|Hard|Linked List, not exactly what was aked| |24.|Swap Nodes in Pairs|Python|Medium|Linked List| |25.|Reverse Nodes in k-Group|Python|Hard|Linked List, Stack| |26.|Remove Duplicates from Sorted Array|Python|Easy|Several solutions in one file| |27.|Remove Element|Python|Easy| |29.|Divide Two Integers|Python|Medium| |33.|Search in Rotated Sorted Array|Python|Medium| |34.|Find First and Last Position of Element in Sorted Array|Python.py)|Medium|Binary Search| |34.|Find First and Last Position of Element in Sorted Array|Python|Medium| |35.|Search Insert Position|Python|Easy|Binary Search| |36.|Valid Sudoku|Python|Medium|Brute Force, set, list| |41.|First Missing Positive|Python|Hard|| |46.|Permutations|Python|Medium|Itertools| |47.|Permutations II|Python|Medium|Itertools| |48.|Rotate Image|Python|Medium|| |49.|Group Anagrams|Python|Medium| |50.|Pow(x, n)|Python.py)|Medium|Recursion| |53.|Maximum Subarray|Python|Easy| |54.|Spiral Matrix|Python|Medium| |55.|Jump Game|Python|Medium| |56.|Merge Intervals|Python|Medium|| |57.|Insert Interval|Python|Hard| |58.|Length of Last Word|Python.py)|Easy|List| |58.|Length of Last Word|Python.py)|Easy|String| |59.|Spiral Matrix II|Python|Medium|spaghetti| |61.|Rotate List|Python|Medium|Linked List| |63.|Unique Paths II|Python|Medium|DP| |64.|Minimum Path Sum|Python|Medium| |66.|Plus One|Python|Easy|| |67.|Add Binary|Python|Easy|| |71.|Simplify Path|Python|Medium|Stack| |73.|Set Matrix Zeroes|Python|Medium|set()| |74.|Search a 2D Matrix|Python|Medium|Binary Search| |75.|Sort Colors|Python.py)|Medium|Bubble Sort| |75.|Sort Colors|Python.py)|Medium|Selection Sort| |75.|Sort Colors|Python.py)|Medium|Insertion Sort| |75.|Sort Colors|Python.py)|Medium|Quick Sort| |75.|Sort Colors|Python.py)|Medium|Merge Sort| |78.|Subsets|Python|Medium|itertools.combinations()| |80.|Remove Duplicates from Sorted Array II|Python|Medium|| |81.|Search in Rotated Sorted Array II|Python|Medium|| |82.|Remove Duplicates from Sorted List II|Python|Medium|Linked List| |83.|Remove Duplicates from Sorted List|Python|Easy|Linked List| |86.|Partition List|Python|Medium|Linked List| |88.|Merge Sorted Array|Python|Easy|Two solutions| |92.|Reverse Linked List II|Python|Medium|Stack, Linked List| |94.|Binary Tree Inorder Traversal|Python|Medium|Binary Tree, Recursion| |98.|Validate Binary Search Tree|Python|Medium|Binary Tree, Recursion| |98.|Validate Binary Search Tree|Python.py)|Medium|Binary Tree, Recursion, another valid. approach| |100.|Same Tree|Python|Easy|Binary Tree (preorder), Recursion| |101.|Symmetric Tree|Python|Easy|BFS, iteratively| |102.|Binary Tree Level Order Traversal|Python|Medium|BFS, Overcode| |103.|Binary Tree Zigzag Level Order Traversal|Python|Medium|BFS| |104.|Maximum Depth of Binary Tree|Python|Easy|Binary Tree, Recursion| |107.|Binary Tree Level Order Traversal II|Python|Easy|BFS| |110.|Balanced Binary Tree|Python|Easy|DFS, Recursion| |111.|Minimum Depth of Binary Tree|Python|Easy|Binary Tree, Recursion| |112.|Path Sum|Python|Easy|Binary Tree, Recursion| |114.|Flatten Binary Tree to Linked List|Python|Medium|DFS, preorder| |116.|Populating Next Right Pointers in Each Node|Python|Medium|BFS| |117.|Populating Next Right Pointers in Each Node II|Python|Medium|BFS, same as 116| |118.|Pascal's Triangle|Python|Easy| |119.|Pascal's Triangle II|Python|Easy| |120.|Triangle|Python|Medium| |121.|Best Time to Buy and Sell Stock|Python|Easy| |122.|Best Time to Buy and Sell Stock II|Python|Easy| |123.|Best Time to Buy and Sell Stock III|Python|Hard| |124.|Binary Tree Maximum Path Sum|Python|Hard| |125.|Valid Palindrome|Python|Easy|Two pointers from start & end| |125.|Valid Palindrome|Python|Easy|Re.findall and left half == rev. right half| |125.|Valid Palindrome|Python|Easy|Re.sub and s == reversed s| |128.|Longest Consecutive Sequence|Python|Medium|| |129.|Sum Root to Leaf Numbers|Python|Medium|DFS| |134.|Gas Station|Python|Medium|| |136.|Single Number|Python|Easy| |137.|Single Number II|Python|Medium|Brute Force| |138.|Copy List with Random Pointer|Python|Medium|Linked List| |139.|Word Break|Python|Medium|Watched how to complete| |141.|Linked List Cycle|Python.py)|Easy|Linked List, Brute Force| |141.|Linked List Cycle|Python|Easy|Linked List, set()| |142.|Linked List Cycle II|Python|Medium|Linked List, set()| |143.|Reorder List|Python|Medium|Linked List, Stack| |144.|Binary Tree Preorder Traversal|Python|Medium|Binary Tree, Recursion| |145.|Binary Tree Postorder Traversal|Python|Hard|Binary Tree, Recursion| |146.|LRU Cache|Python|Medium| |147.|Insertion Sort List|Python|Medium|Not exactly what asked, Linked List, Binary Search| |148.|Sort List|Python|Medium|Linked List, Brute Force| |150.|Evaluate Reverse Polish Notation|Python|Medium|Stack| |152.|Maximum Product Subarray|Python|Medium|DP| |153.|Find Minimum in Rotated Sorted Array|Python.py)|Medium|For loop| |153.|Find Minimum in Rotated Sorted Array|Python.py)|Medium|Binary Search| |154.|Find Minimum in Rotated Sorted Array II|Python|Hard|For loop| |155.|Min Stack|Python|Easy| |160.|Intersection of Two Linked Lists|Python|Easy|Linked List| |162.|Find Peak Element|Python|Medium| |164.|Maximum Gap|Python|Hard| |165.|Compare Version Numbers|Python|Medium| |167.|Two Sum II - Input array is sorted|Python|Easy| |168.|Excel Sheet Column Title|Python|Easy| |171.|Excel Sheet Column Number|Python|Easy|| |172.|Factorial Trailing Zeroes|Python|Easy|Brute Force| |173.|Binary Search Tree Iterator|Python|Medium|inorder| |179.|Largest Number|Python|Medium|Bubble sort| |191.|Number of 1 Bits|Python|Easy|| |198.|House Robber|Python|Easy|| |199.|Binary Tree Right Side View|Python|Medium|BFS| |200.|Number of Islands|Python|Medium| |201.|Bitwise AND of Numbers Range|Python|Medium| |202.|Happy Number|Python|Easy| |203.|Remove Linked List Elements|Python|Easy|Linked List| |204.|Count Primes|Python|Easy| |205.|Isomorphic Strings|Python|Easy|Dictionary| |206.|Reverse Linked List|Python|Easy|Linked List, brute force| |206.|Reverse Linked List|Python.py)|Easy|Linked List| |208.|Implement Trie (Prefix Tree)|Python.py)|Medium|Trie, 1st time all by myself| |209.|Minimum Size Subarray Sum|Python|Medium| |211.|Add and Search Word - Data structure design|Python|Medium|Need to resolve| |215.|Kth Largest Element in an Array|Python|Medium|sorted()| |216.|Combination Sum III|Python|Medium|Backtracking| |217.|Contains Duplicate|Python.py)|Easy|Dictionary| |219.|Contains Duplicate II|Python|Easy|Dictionary, enumerate| |220.|Contains Duplicate III|Python|Medium|Two pointers?| |221.|Maximal Square|Python|Medium| |222.|Count Complete Tree Nodes|Python|Medium|Recursion| |225.|Implement Stack using Queues|Python|Easy|List| |226.|Invert Binary Tree|Python|Easy|Recursion| |227.|Basic Calculator II|Python|Medium|Queue, Brute Force| |228.|Summary Ranges|Python|Medium|Two Pointers| |229.|Majority Element II|Python.py)|Medium|Brute Force| |229.|Majority Element II|Python|Medium|a bit optimized| |230.|Kth Smallest Element in a BST|Python|Medium|Recursion, inorder, brute force| |232.|Implement Queue using Stacks|Python|Easy|List| |234.|Palindrome Linked List|Python|Easy|Linked List| |237.|Delete Node in a Linked List|Python|Easy|Linked List| |238.|Product of Array Except Self|Python|Medium| |240.|Search a 2D Matrix II|Python|Medium|Binary Search| |242.|Valid Anagram|Python|Easy| |257.|Binary Tree Paths|Python|Easy|Binary Tree (preorder), Recursion| |258.|Add Digits|Python|Easy|| |260.|Single Number III|Python|Medium|Set| |268.|Missing Number|Python|Easy| |274.|H-Index|Python|Medium| |275.|H-Index II|Python|Medium|Solution for problem #274 worked fine| |283.|Move Zeroes|Python|Easy| |284.|Peeking Iterator|Python|Medium|| |289.|Game of Life|Python|Medium|| |290.|Word Pattern|Python|Easy|Dictionary, enumerate| |295.|Find Median from Data Stream|Python.py)|Hard|Brute Force| |295.|Find Median from Data Stream|Python.py)|Hard|Binary Search| |297.|Serialize and Deserialize Binary Tree|Python|Hard|BFS| |299.|Bulls and Cows|Python|Easy|| |304.|Range Sum Query 2D - Immutable|Python.py)|Medium|Brute force| |304.|Range Sum Query 2D - Immutable|Python.py)|Medium|A bit optimized but still brute force| |307.|Range Sum Query - Mutable|Python|Medium|| |318.|Maximum Product of Word Lengths|Python|Medium|Brute Force| |326.|Power of Three|Python|Easy|while| |328.|Odd Even Linked List|Python|Medium|Linked List| |329.|Longest Increasing Path in a Matrix|Python|Hard|DFS, LRU_cache, Brute Force| |334.|Increasing Triplet Subsequence|Python|Medium|Brute Force| |341.|Flatten Nested List Iterator|Python|Medium|| |342.|Power of Four|Python.py)|Easy|Brute Force| |342.|Power of Four|Python|Easy|Bitwise| |344.|Reverse String|Python|Easy| |345.|Reverse Vowels of a String|Python.py)|Easy|String, in-place, slow| |345.|Reverse Vowels of a String|Python.py)|Easy|List, fast, ~x4| |347.|Top K Frequent Elements|Python|Medium|Hash Table| |355.|Design Twitter|Python|Medium|May be improved with collections| |376.|Wiggle Subsequence|Python|Medium|| |378.|Kth Smallest Element in a Sorted Matrix|Python|Medium|Converted matrix into list| |380.|Insert Delete GetRandom O(1)|Python.py)|Medium|not O(1), Brute force| |381.|Insert Delete GetRandom O(1) - Duplicates allowed|Python-Duplicatesallowed.py)|Hard|not O(1), Brute force| |382.|Linked List Random Node|Python|Medium|random.choice()| |384.|Shuffle an Array|Python|Medium|random.sample()| |387.|First Unique Character in a String|Python.py)|Easy|Brute Force| |387.|First Unique Character in a String|Python|Easy|Dictionary, enumerate| |389.|Find the Difference|Python.py)|Easy|set, .count()| |389.|Find the Difference|Python|Easy|.replace()| |392.|Is Subsequence|Python|Easy|| |394.|Decode String|Python|Medium|Stack| |395.|Longest Substring with At Least K Repeating Characters|Python|Medium|collections, Recursion| |398.|Random Pick Index|Python|Medium|random.choice()| |399.|Evaluate Division|Python|Medium|God bless youtube| |402.|Remove K Digits|Python|Medium|Stack| |404.|Sum of Left Leaves|Python|Easy|Recursion, preorder| |409.|Longest Palindrome|Python|Easy|| |412.|Fizz Buzz|Python|Easy|| |421.|Maximum XOR of Two Numbers in an Array|Python|Medium|googled soln| |423.|Reconstruct Original Digits from English|Python|Medium|| |429.|N-ary Tree Level Order Traversal|Python|Medium|BFS| |432.|All O\one Data Structure|Python|Hard|Dictionary as Data Structure| |435.|Non-overlapping Intervals|Python|Medium|lambda| |436.|Find Right Interval|Python|Medium|Brute Force| |437.|Path Sum III|Python|Medium|DFS| |441.|Arranging Coins|Python|Easy|Iteratively| |442.|Find All Duplicates in an Array|Python|Medium|set()| |445.|Add Two Numbers II|Python|Medium|converted to int and back to Linked List| |449.|Serialize and Deserialize BST|Python|Medium|Complicated solution - resolve| |450.|Delete Node in a BST|Python|Medium|Binary Search Tree, Recursion| |451.|Sort Characters By Frequency|Python|Medium|Surprisingly fast solution| |452.|Minimum Number of Arrows to Burst Balloons|Python|Medium|| |454.|4Sum II|Python|Medium|Dictionary| |456.|132 Pattern|Python|Medium|Brute Force| |458.|Poor Pigs|Python|Hard|math| |459.|Repeated Substring Pattern|Python|Easy|| |462.|Minimum Moves to Equal Array Elements II|Python|Medium|median| |468.|Validate IP Address|Python|Medium|| |470.|Implement Rand10() Using Rand7()|PythonUsingRand7().py)|Medium|'Invented the wheel'| |476.|Number Complement|Python|Easy|| |478.|Generate Random Point in a Circle|Python|Medium|| |495.|Teemo Attacking|Python|Medium|| |496.|Next Greater Element I|Python|Easy|Brute force - resolve| |497.|Random Point in Non-overlapping Rectangles|Python|Medium|Random, Bisect| |498.|Diagonal Traverse|Python|Medium|Used theory from GfG.com| |500.|Keyboard Row|Python|Easy|Dictionary| |501.|Find Mode in Binary Search Tree|Python|Easy|Recursion| |503.|Next Greater Element II|Python|Medium|Brute Force| |509.|Fibonacci Number|Python.py)|Easy|List| |509.|Fibonacci Number|Python.py)|Easy|Dictionary| |509.|Fibonacci Number|Python.py)|Easy|Used two variables n1 & n2| |513.|Find Bottom Left Tree Value|Python|Medium|BFS| |515.|Find Largest Value in Each Tree Row|Python|Medium|BFS| |520.|Detect Capital|Python|Easy|Built-in functions| |524.|Longest Word in Dictionary through Deleting|Python|Medium|| |525.|Contiguous Array|Python|Medium| |526.|Beautiful Arrangement|Python|Medium|DFS, brute force| |530.|Minimum Absolute Difference in BST|Python|Easy|Bad solution - resolve| |532.|K-diff Pairs in an Array|Python|Medium|Brute force| |535.|Encode and Decode TinyURL|Python|Medium|Dictionary as db, random generated url| |538.|Convert BST to Greater Tree|Python|Easy|DFS, recursion| |540.|Single Element in a Sorted Array|Python|Medium|Binary Search| |543.|Diameter of Binary Tree|Python|Easy| |554.|Brick Wall|Python|Medium|Hash Table| |556.|Next Greater Element III|Python|Medium|| |559.|Maximum Depth of N-ary Tree|Python|Easy|BFS| |560.|Subarray Sum Equals K|Python|Medium| |563.|Binary Tree Tilt|Python|Easy|Binary Tree, postorder, overcode| |566.|Reshape the Matrix|Python|Easy|Brute Force| |575.|Distribute Candies|Python|Easy|| |581.|Shortest Unsorted Continuous Subarray|Python|Medium|| |589.|N-ary Tree Preorder Traversal|Python|Easy|Recursion| |590.|N-ary Tree Postorder Traversal|Python|Easy|Recursion| |593.|Valid Square|Python|Medium|| |594.|Longest Harmonious Subsequence|Python.py)|Easy|defaultdict| |594.|Longest Harmonious Subsequence|Python.py)|Easy|Counter| |599.|Minimum Index Sum of Two Lists|Python|Easy|Dictionary, enumerate| |605.|Can Place Flowers|Python|Easy|simple counter| |609.|Find Duplicate File in System|Python|Medium|Dictionary, nested for loop, list comprehension| |622.|Design Circular Queue|Python|Medium|Implement through list (first time)| |623.|Add One Row to Tree|Python|Medium|BFS| |637.|Average of Levels in Binary Tree|Python|Easy|Binary Tree, Recursion| |641.|Design Circular Deque|Python|Medium|Need to resolve without use of builtin functions (first time)| |645.|Set Mismatch|Python|Easy|collections.Counter| |647.|Palindromic Substrings|Python|Medium|| |653.|Two Sum IV - Input is a BST|Python|Easy|Brute Force - resolve| |654.|Maximum Binary Tree|Python|Medium|DFS, Recursion| |657.|Robot Return to Origin|Python|Easy|Dictionary| |658.|Find K Closest Elements|Python|Medium|Binary Search| |665.|Non-decreasing Array|Python|Easy|Brute Force| |667.|Beautiful Arrangement II|Python|Medium|| |671.|Second Minimum Node In a Binary Tree|Python|Easy|DFS, Recursion| |674.|Longest Continuous Increasing Subsequence|Python|Easy|simple counter| |677.|Map Sum Pairs|Python|Medium|Trie| |678.|Valid Parenthesis String|Python|Medium| |682.|Baseball Game|Python|Easy|| |690.|Employee Importance|Python|Easy|BFS| |695.|Max Area of Island|Python|Medium|DFS| |696.|Count Binary Substrings|Python|Easy| |700.|Search in a Binary Search Tree|Python|Easy|Binary Search Tree, Recursion| |701.|Insert into a Binary Search Tree|Python|Medium|Binary Search Tree, Recursion| |703.|Kth Largest Element in a Stream|Python|Easy|brute force| |705.|Design HashSet|Python|Easy|list as a set| |706.|Design HashMap|Python|Easy|list| |707.|Design Linked List|Python|Medium|Linked List, first time| |709.|To Lower Case|Python|Easy|Two solutions. 1st w. in place changes, 2nd saves in var| |713.|Subarray Product Less Than K|Python|Medium|Two pointers| |720.|Longest Word in Dictionary|Python|Easy|Trie| |722.|Remove Comments|Python|Medium|String| |728.|Self Dividing Numbers|Python|Easy|Math| |729.|My Calendar I|Python|Medium|Limked List, Dictionary| |735.|Asteroid Collision|Python|Medium|Stack| |744.|Find Smallest Letter Greater Than Target|Python|Easy|Binary Search| |746.|Min Cost Climbing Stairs|Python|Easy|DP| |754.|Reach a Number|Python|Medium|Math| |763.|Partition Labels|Python.py)|Medium|Brute Force - resolve| |771.|Jewels and Stones|Python|Easy|while loop, for loop and list comprehension| |775.|Global and Local Inversions|Python|Medium|| |785.|Is Graph Bipartite?|Python|Medium|Iteratively BFS, stack, XOR| |791.|Custom Sort String|Python|Medium|| |804.|Unique Morse Code Words|Python|Easy|Dictionary| |807.|Max Increase to Keep City Skyline|Python|Medium|| |811.|Subdomain Visit Count|Python|Easy|Dictionary| |817.|Linked List Components|Python.py)|Medium|Set| |817.|Linked List Components|Python|Medium|List, 35 times slower| |820.|Short Encoding of Words|Python|Medium|Brute Force| |821.|Shortest Distance to a Character|Python|Easy|overcode| |824.|Goat Latin|Python|Easy|| |832.|Flipping an Image|Python|Easy|| |832.|Flipping an Image|Python.py)|Easy|.reverse()| |835.|Image Overlap|Python|Medium|Brute Force| |841.|Keys and Rooms|Python|Medium|BFS| |844.|Backspace String Compare|Python|Easy| |845.|Longest Mountain in Array|Python|Medium|one pass| |849.|Maximize Distance to Closest Person|Python|Medium| |852.|Peak Index in a Mountain Array|Python.py)|Easy|List comprehension| |852.|Peak Index in a Mountain Array|Python.py)|Easy|Set| |858.|Mirror Reflection|Python|Medium|| |859.|Buddy Strings|Python|Easy|Brute Force| |865.|Smallest Subtree with all the Deepest Nodes|Python|Medium|DFS, Recursion| |869.|Reordered Power of 2|Python|Medium|int to string| |872.|Leaf-Similar Trees|Python|Easy|Recursion| |876.|Middle of the Linked List|Python|Easy| |880.|Decoded String at Index|Python|Medium| |881.|Boats to Save People|Python|Medium|Two Pointers| |884.|Uncommon Words from Two Sentences|Python|Easy|simple counter| |890.|Find and Replace Pattern|Python|Medium|Dictionary| |895.|Maximum Frequency Stack|Python|Hard|| |896.|Monotonic Array|Python|Easy|| |897.|Increasing Order Search Tree|Python|Easy|DFS, iteratively| |900.|RLE Iterator|Python|Medium|| |905.|Sort Array By Parity|Python|Easy|List| |908.|Smallest Range I|Python|Easy|| |910.|Smallest Range II|Python|Medium|| |911.|Online Election|Python|Medium|Binary Search| |912.|Sort an Array|Python|Medium|sorted()| |916.|Word Subsets|Python|Medium|collections.Counter, Dictionary| |922.|Sort Array By Parity II|Python.py)|Easy|Dictionary| |922.|Sort Array By Parity II|Python.py)|Easy|List| |922.|Sort Array By Parity II|Python.py)|Easy|Two Pointers| |923.|3Sum With Multiplicity|Python|Medium|collections.Counter| |929.|Unique Email Addresses|Python|Easy| |933.|Number of Recent Calls|Python.py)|Easy|Binary Search and rewrite list| |933.|Number of Recent Calls|Python.py)|Easy|while and rewrite list| |933.|Number of Recent Calls|Python.py)|Easy|while and .pop()| |938.|Range Sum of BST|Python|Easy|Binary Search Tree| |938.|Range Sum of BST|Python.py)|Easy|Binary Search Tree, Optimized solution| |941.|Valid Mountain Array|Python|Easy|| |946.|Validate Stack Sequences|Python|Medium|Stack| |949.|Largest Time for Given Digits|Python|Easy|Itertools| |952.|Largest Component Size by Common Factor|Python|Hard|Googled soln| |953.|Verifying an Alien Dictionary|Python|Easy|| |961.|N-Repeated Element in Size 2N Array|Python.py)|Easy|Brute Force| |961.|N-Repeated Element in Size 2N Array|Python|Easy|Dictionary, a bit optimized| |965.|Univalued Binary Tree|Python|Easy|Binary Tree, Recursion| |966.|Vowel Spellchecker|Python|Medium|Dictionary| |967.|Numbers With Same Consecutive Differences|Python|Medium|DFS`| |969.|Pancake Sorting|Python|Medium|sort| |970.|Powerful Integers|Python🔗 More in this category