jaredliw / python-question-bank

Python solutions of problems from various competitive programming platforms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-question-bank

Python solutions of problems from various competitive programming platforms.

Lines of code GitHub commit activity

Table of Contents

CSES Problem Set

Kattis

Leetcode

  1. Two Sum

  2. Add Two Numbers

  3. Longest Substring Without Repeating Characters

  4. Reverse Integer

  5. Palindrome Number

  6. Roman to Integer

  7. Longest Common Prefix

  8. Remove Nth Node From End of List

  9. Valid Parentheses

  10. Merge Two Sorrted Lists

  11. Swap Nodes in Pairs

  12. Remove Duplicates from Sorted Array

  13. Remove Element

  14. Implement strStr()

  15. Search in Rotated Sorted Array

  16. Find First and Last Position of Element in Sorted Array

  17. Search Insert Position

  18. Maximum Subarray

  19. Length of Last Word

  20. Rotate List

  21. Plus One

  22. Add Binary

  23. Sqrt(x)

  24. Climbing Stairs

  25. Search a 2D Matrix

  26. Search in Rotated Sorted Array II

  27. Remove Duplicates from Sorted List II

  28. Remove Duplicates from Sorted List

  29. Partition List

  30. Merge Sorted Array

  31. Reverse Linked List II

  32. Pascal's Triangle

  33. Valid Palindrome

  34. Single Number

  35. Linked List Cycle

  36. Linked List Cycle II

  37. Insertion Sort List

  38. Find Minimum in Rotated Sorted Array

  39. Find Minimum in Rotated Sorted Array II

  40. Intersection of Two Linked Lists

  41. Two Sum II - Input array is sorted

  42. Excel Sheet Column Title

  43. Excel Sheet Column Number

  44. Factorial Trailing Zeroes

  45. Duplicate Emails

  46. Customers Who Never Order

  47. Remove Linked List Elements

  48. Isomorphic Strings

  49. Reverse Linked List

  50. Minimum Size Subarray Sum

  51. Contains Duplicate

  52. Count Complete Tree Nodes

  53. Summary Ranges

  54. Power of Two

  55. Palindrome Linked List

  56. Delete Node in a Linked List

  57. Valid Anagram

  58. Add Digits

  59. Ugly Number

  60. Missing Number

  61. First Bad Version

  62. Move Zeroes

  63. Word Pattern

  64. Range Sum Query - Immutable

  65. Odd Even Linked List

  66. Reverse String

  67. Reverse Vowels of a String

  68. Intersection of Two Arrays

  69. Intersection of Two Arrays II

  70. Valid Perfect Square

  71. Guess Number Higher or Lower

  72. Ransom Note

  73. First Unique Character in a String

  74. Find the Difference

  75. Is Subsequence

  76. Binary Watch

  77. Convert a Number to Hexadecimal

  78. Longest Palindrome

  79. Fizz Buzz

  80. Third Maximum Number

  81. Add Strings

  82. Number of Segments in a String

  83. Arranging Coins

  84. Find All Numbers Disappeared in an Array

  85. Assign Cookies

  86. Repeated Substring Pattern

  87. Hamming Distance

  88. Island Perimeter

  89. Number Complement

  90. Max Consecutive Ones

  91. Construct the Rectangle

  92. Keyboard Row

  93. Base 7

  94. Perfect Number

  95. Fibonacci Number

  96. Detect Capital

  97. Duplicate Zeros

  98. Encode and Decode TinyURL

  99. Student Attendance Record I

  100. Reverse Words in a String III

  101. Subarray Sum Equals K

  102. Distribute Candies

  103. Big Countries

  104. Can Place Flowers

  105. Not Boring Movies

  106. Maximum Average Subarray I

  107. Robot Return to Origin

  108. Longest Continuous Increasing Subsequence

  109. Baseball Game

  110. Binary Number with Alternating Bits

  111. Binary Search

  112. Design HashSet

  113. Design HashMap

  114. To Lower Case

  115. Find Pivot Index

  116. Self Dividing Numbers

  117. Find Smallest Letter Greater Than Target

  118. Largest Number At Least Twice of Others

  119. Shortest Completing Word

  120. Prime Number of Set Bits in Binary Representation

  121. Jewels and Stones

  122. Rotate String

  123. Unique Morse Code Words

  124. Number of Lines To Write String

  125. Max Increase to Keep City Skyline

  126. Subdomain Visit Count

  127. Goat Latin

  128. Positions of Large Groups

  129. Flipping an Image

  130. Peak Index in a Mountain Array

  131. Transpose Matrix

  132. Middle of the Linked List

  133. Projection Area of 3D Shapes

  134. Uncommon Words from Two Sentences

  135. Surface Area of 3D Shapes

  136. Monotonic Array

  137. Sort Array By Parity

  138. Sort an Array

  139. Unique Email Addresses

  140. Number of Recent Calls

  141. Valid Mountain Array

  142. Delete Columns to Make Sorted

  143. Verifying an Alien Dictionary

  144. Subarray Sums Divisible by K

  145. Squares of a Sorted Array

  146. Add to Array-Form of Integer

  147. Find the Town Judge

  148. Find Common Characters

  149. Complement of Base 10 Integer

  150. Remove Outermost Parentheses

  151. Remove All Adjacent Duplicates In String

  152. Height Checker

  153. Occurrences After Bigram

  154. Defanging an IP Address

  155. N-th Tribonacci Number

  156. Prime Arrangements

  157. Distance Between Bus Stops

  158. Maximum Number of Balloons

  159. Unique Number of Occurrences

  160. Split a String in Balanced Strings

  161. Check If It Is a Straight Line

  162. Minimum Time Visiting All Points

  163. Subtract the Product and Sum of Digits of an Integer

  164. Group the People Given the Group Size They Belong To

  165. Convert Binary Number in a Linked List to Integer

  166. Find Numbers with Even Number of Digits

  167. Replace Elements with Greatest Element on Right Side

  168. Find N Unique Integers Sum up to Zero

  169. Decrypt String from Alphabet to Integer Mapping

  170. Decompress Run-Length Encoded List

  171. Check If N and Its Double Exist

  172. Generate a String With Characters That Have Odd Counts

  173. Find Lucky Integer in an Array

  174. Display Table of Food Orders in a Restaurant

  175. Maximum 69 Number

  176. Sort the Matrix Diag onally

  177. Remove Palindromic Subsequences

  178. Number of Steps to Reduce a Number to Zero

  179. Check If N and Its Double Exist

  180. Sort Integers by The Number of 1 Bits

  181. How Many Numbers Are Smaller Than the Current Number

  182. Create Target Array in the Given Order

  183. String Matching in an Array

  184. Queries on a Permutation With Key

  185. Maximum Score After Splitting a String

  186. Kids With the Greatest Number of Candies

  187. Destination City

  188. Check If All 1's Are at Least Length K Places Away

  189. Build an Array With Stack Operations

  190. Consecutive Characters

  191. Number of Students Doing Homework at a Given Time

  192. Check If a Word Occurs As a Prefix of Any Word in a Sentence

  193. Maximum Product of Two Elements in an Array

  194. Shuffle the Array

  195. Subrectangle Queries

  196. Running Sum of 1d Array

  197. XOR Operation in an Array

  198. Average Salary Excluding the Minimum and Maximum Salary

  199. Path Crossing

  200. Can Make Arithmetic Progression From Sequence

  201. Reformat Date

  202. Number of Good Pairs

  203. Water Bottles

  204. Count Odd Numbers in an Interval Range

  205. Shuffle String

  206. Count Good Triplets

  207. Make The String Great

  208. Three Consecutive Odds

  209. Thousand Separator

  210. Matrix Diagonal Sum

  211. Sum of All Odd Length Subarrays

  212. Crawler Log Folder

  213. Design Parking System

  214. Special Array With X Elements Greater Than or Equal X

  215. Maximum Nesting Depth of the Parentheses

  216. Slowest Key

  217. Widest Vertical Area Between Two Poin ts Containing No Points

  218. Design an Ordered Stream

  219. Check If Two String Arrays are Equivalent

  220. Richest Customer Wealth

  221. Goal Parser Interpretation

  222. Count the Number of Consistent Strings

  223. Count of Matches in Tournament

  224. Partitioning Into Minimum Number Of Deci-Binary Numbers

  225. Reformat Phone Number

  226. Determine if String Halves Are Alike

  227. Maximum Units on a Truck

  228. Calculate Money in Leetcode Bank

  229. Decode XORed Array

  230. Find the Highest Altitude

  231. Latest Time by Replacing Hidden Digits

  232. Sum of Unique Elements

  233. Minimum Changes To Make Alternating Binary String

  234. Merge Strings Alternately

  235. Minimum Number of Operations to Move All Balls to Each Box

  236. Count Items Matching a Rule

  237. Find Center of Star Graph

  238. Second Largest Digit in a String

  239. Maximum Ascending Subarray Sum

  240. Number of Different Integers in a String

  241. Determine Color of a Chessboard Square

  242. Truncate Sentence

  243. Finding the Users Active Minutes

  244. Sign of the Product of an Array

  245. Minimum Operations to Make the Array Increasing

  246. Queries on Number of Points Inside a Circle

  247. Check if the Sentence Is Pangram

  248. Maximum Ice Cream Bars

  249. Sum of Digits in Base K

  250. Check if Word Equals Summation of Two Words

  251. Replace All Digits with Characters

  252. Seat Reservation Manager

  253. Sorting the Sentence

  254. Sum of All Subset XOR Totals

  255. Longer Contiguous Segments of Ones than Zeros

  256. Find Target Indices After Sorting Array

About

Python solutions of problems from various competitive programming platforms.

License:MIT License


Languages

Language:Python 99.7%Language:C++ 0.3%