offcode 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1038) hide show
  1. package/README.md +38 -2
  2. package/data/index.json +1 -0
  3. package/data/problems/01-matrix.json +1 -0
  4. package/data/problems/1-bit-and-2-bit-characters.json +1 -0
  5. package/data/problems/132-pattern.json +1 -0
  6. package/data/problems/2-keys-keyboard.json +1 -0
  7. package/data/problems/24-game.json +1 -0
  8. package/data/problems/3sum-closest.json +1 -0
  9. package/data/problems/3sum-smaller.json +1 -0
  10. package/data/problems/3sum-with-multiplicity.json +1 -0
  11. package/data/problems/3sum.json +1 -0
  12. package/data/problems/4-keys-keyboard.json +1 -0
  13. package/data/problems/4sum-ii.json +1 -0
  14. package/data/problems/4sum.json +1 -0
  15. package/data/problems/accounts-merge.json +1 -0
  16. package/data/problems/add-binary.json +1 -0
  17. package/data/problems/add-bold-tag-in-string.json +1 -0
  18. package/data/problems/add-digits.json +1 -0
  19. package/data/problems/add-one-row-to-tree.json +1 -0
  20. package/data/problems/add-strings.json +1 -0
  21. package/data/problems/add-to-array-form-of-integer.json +1 -0
  22. package/data/problems/add-two-numbers-ii.json +1 -0
  23. package/data/problems/add-two-numbers.json +1 -0
  24. package/data/problems/additive-number.json +1 -0
  25. package/data/problems/advantage-shuffle.json +1 -0
  26. package/data/problems/alien-dictionary.json +1 -0
  27. package/data/problems/all-nodes-distance-k-in-binary-tree.json +1 -0
  28. package/data/problems/all-oone-data-structure.json +1 -0
  29. package/data/problems/all-paths-from-source-to-target.json +1 -0
  30. package/data/problems/all-possible-full-binary-trees.json +1 -0
  31. package/data/problems/ambiguous-coordinates.json +1 -0
  32. package/data/problems/android-unlock-patterns.json +1 -0
  33. package/data/problems/arithmetic-slices-ii-subsequence.json +1 -0
  34. package/data/problems/arithmetic-slices.json +1 -0
  35. package/data/problems/arranging-coins.json +1 -0
  36. package/data/problems/array-nesting.json +1 -0
  37. package/data/problems/array-of-doubled-pairs.json +1 -0
  38. package/data/problems/array-partition.json +1 -0
  39. package/data/problems/assign-cookies.json +1 -0
  40. package/data/problems/asteroid-collision.json +1 -0
  41. package/data/problems/available-captures-for-rook.json +1 -0
  42. package/data/problems/average-of-levels-in-binary-tree.json +1 -0
  43. package/data/problems/backspace-string-compare.json +1 -0
  44. package/data/problems/bag-of-tokens.json +1 -0
  45. package/data/problems/balanced-binary-tree.json +1 -0
  46. package/data/problems/base-7.json +1 -0
  47. package/data/problems/baseball-game.json +1 -0
  48. package/data/problems/basic-absolute-value.json +1 -0
  49. package/data/problems/basic-array-max.json +1 -0
  50. package/data/problems/basic-array-min.json +1 -0
  51. package/data/problems/basic-array-sum-rec.json +1 -0
  52. package/data/problems/basic-array-sum.json +1 -0
  53. package/data/problems/basic-average-floor.json +1 -0
  54. package/data/problems/basic-bubble-sort.json +1 -0
  55. package/data/problems/basic-calculator-ii.json +1 -0
  56. package/data/problems/basic-calculator-iii.json +1 -0
  57. package/data/problems/basic-calculator-iv.json +1 -0
  58. package/data/problems/basic-calculator.json +1 -0
  59. package/data/problems/basic-collatz-steps.json +1 -0
  60. package/data/problems/basic-contains-value.json +1 -0
  61. package/data/problems/basic-count-above.json +1 -0
  62. package/data/problems/basic-count-char.json +1 -0
  63. package/data/problems/basic-count-digits.json +1 -0
  64. package/data/problems/basic-count-evens.json +1 -0
  65. package/data/problems/basic-count-pairs.json +1 -0
  66. package/data/problems/basic-count-vowels.json +1 -0
  67. package/data/problems/basic-count-words.json +1 -0
  68. package/data/problems/basic-countdown.json +1 -0
  69. package/data/problems/basic-double-array.json +1 -0
  70. package/data/problems/basic-factorial-rec.json +1 -0
  71. package/data/problems/basic-factorial.json +1 -0
  72. package/data/problems/basic-fibonacci.json +1 -0
  73. package/data/problems/basic-find-index.json +1 -0
  74. package/data/problems/basic-gcd.json +1 -0
  75. package/data/problems/basic-grade-letter.json +1 -0
  76. package/data/problems/basic-has-duplicate.json +1 -0
  77. package/data/problems/basic-is-even.json +1 -0
  78. package/data/problems/basic-is-leap-year.json +1 -0
  79. package/data/problems/basic-is-sorted.json +1 -0
  80. package/data/problems/basic-max-frequency.json +1 -0
  81. package/data/problems/basic-max-of-three.json +1 -0
  82. package/data/problems/basic-max-of-two.json +1 -0
  83. package/data/problems/basic-palindrome-text.json +1 -0
  84. package/data/problems/basic-power-rec.json +1 -0
  85. package/data/problems/basic-power.json +1 -0
  86. package/data/problems/basic-repeat-string.json +1 -0
  87. package/data/problems/basic-reverse-array.json +1 -0
  88. package/data/problems/basic-reverse-number.json +1 -0
  89. package/data/problems/basic-reverse-text-rec.json +1 -0
  90. package/data/problems/basic-reverse-text.json +1 -0
  91. package/data/problems/basic-second-largest.json +1 -0
  92. package/data/problems/basic-sort-two.json +1 -0
  93. package/data/problems/basic-staircase.json +1 -0
  94. package/data/problems/basic-string-length.json +1 -0
  95. package/data/problems/basic-sum-1-to-n.json +1 -0
  96. package/data/problems/basic-sum-digits-rec.json +1 -0
  97. package/data/problems/basic-sum-multiples.json +1 -0
  98. package/data/problems/basic-sum-of-digits.json +1 -0
  99. package/data/problems/basic-temperature-advice.json +1 -0
  100. package/data/problems/basic-to-upper.json +1 -0
  101. package/data/problems/basic-triangle-sum.json +1 -0
  102. package/data/problems/battleships-in-a-board.json +1 -0
  103. package/data/problems/beautiful-arrangement-ii.json +1 -0
  104. package/data/problems/beautiful-arrangement.json +1 -0
  105. package/data/problems/beautiful-array.json +1 -0
  106. package/data/problems/best-meeting-point.json +1 -0
  107. package/data/problems/best-time-to-buy-and-sell-stock-ii.json +1 -0
  108. package/data/problems/best-time-to-buy-and-sell-stock-iii.json +1 -0
  109. package/data/problems/best-time-to-buy-and-sell-stock-iv.json +1 -0
  110. package/data/problems/best-time-to-buy-and-sell-stock-with-cooldown.json +1 -0
  111. package/data/problems/best-time-to-buy-and-sell-stock-with-transaction-fee.json +1 -0
  112. package/data/problems/best-time-to-buy-and-sell-stock.json +1 -0
  113. package/data/problems/binary-gap.json +1 -0
  114. package/data/problems/binary-number-with-alternating-bits.json +1 -0
  115. package/data/problems/binary-search-tree-iterator.json +1 -0
  116. package/data/problems/binary-search.json +1 -0
  117. package/data/problems/binary-subarrays-with-sum.json +1 -0
  118. package/data/problems/binary-tree-cameras.json +1 -0
  119. package/data/problems/binary-tree-inorder-traversal.json +1 -0
  120. package/data/problems/binary-tree-level-order-traversal-ii.json +1 -0
  121. package/data/problems/binary-tree-level-order-traversal.json +1 -0
  122. package/data/problems/binary-tree-longest-consecutive-sequence-ii.json +1 -0
  123. package/data/problems/binary-tree-longest-consecutive-sequence.json +1 -0
  124. package/data/problems/binary-tree-maximum-path-sum.json +1 -0
  125. package/data/problems/binary-tree-paths.json +1 -0
  126. package/data/problems/binary-tree-postorder-traversal.json +1 -0
  127. package/data/problems/binary-tree-preorder-traversal.json +1 -0
  128. package/data/problems/binary-tree-pruning.json +1 -0
  129. package/data/problems/binary-tree-right-side-view.json +1 -0
  130. package/data/problems/binary-tree-tilt.json +1 -0
  131. package/data/problems/binary-tree-upside-down.json +1 -0
  132. package/data/problems/binary-tree-vertical-order-traversal.json +1 -0
  133. package/data/problems/binary-tree-zigzag-level-order-traversal.json +1 -0
  134. package/data/problems/binary-trees-with-factors.json +1 -0
  135. package/data/problems/binary-watch.json +1 -0
  136. package/data/problems/bitwise-and-of-numbers-range.json +1 -0
  137. package/data/problems/bitwise-ors-of-subarrays.json +1 -0
  138. package/data/problems/boats-to-save-people.json +1 -0
  139. package/data/problems/bold-words-in-string.json +1 -0
  140. package/data/problems/bomb-enemy.json +1 -0
  141. package/data/problems/boundary-of-binary-tree.json +1 -0
  142. package/data/problems/brick-wall.json +1 -0
  143. package/data/problems/bricks-falling-when-hit.json +1 -0
  144. package/data/problems/broken-calculator.json +1 -0
  145. package/data/problems/buddy-strings.json +1 -0
  146. package/data/problems/build-a-matrix-with-conditions.json +1 -0
  147. package/data/problems/bulb-switcher-ii.json +1 -0
  148. package/data/problems/bulb-switcher.json +1 -0
  149. package/data/problems/bulls-and-cows.json +1 -0
  150. package/data/problems/burst-balloons.json +1 -0
  151. package/data/problems/bus-routes.json +1 -0
  152. package/data/problems/can-i-win.json +1 -0
  153. package/data/problems/can-place-flowers.json +1 -0
  154. package/data/problems/candy-crush.json +1 -0
  155. package/data/problems/candy.json +1 -0
  156. package/data/problems/capacity-to-ship-packages-within-d-days.json +1 -0
  157. package/data/problems/car-fleet.json +1 -0
  158. package/data/problems/car-pooling.json +1 -0
  159. package/data/problems/card-flipping-game.json +1 -0
  160. package/data/problems/cat-and-mouse.json +1 -0
  161. package/data/problems/chalkboard-xor-game.json +1 -0
  162. package/data/problems/champagne-tower.json +1 -0
  163. package/data/problems/cheapest-flights-within-k-stops.json +1 -0
  164. package/data/problems/check-completeness-of-a-binary-tree.json +1 -0
  165. package/data/problems/cherry-pickup.json +1 -0
  166. package/data/problems/circular-array-loop.json +1 -0
  167. package/data/problems/climbing-stairs.json +1 -0
  168. package/data/problems/clone-graph.json +1 -0
  169. package/data/problems/closest-binary-search-tree-value-ii.json +1 -0
  170. package/data/problems/closest-binary-search-tree-value.json +1 -0
  171. package/data/problems/closest-leaf-in-a-binary-tree.json +1 -0
  172. package/data/problems/coin-change-ii.json +1 -0
  173. package/data/problems/coin-change.json +1 -0
  174. package/data/problems/coin-path.json +1 -0
  175. package/data/problems/combination-sum-ii.json +1 -0
  176. package/data/problems/combination-sum-iii.json +1 -0
  177. package/data/problems/combination-sum-iv.json +1 -0
  178. package/data/problems/combination-sum.json +1 -0
  179. package/data/problems/combinations.json +1 -0
  180. package/data/problems/compare-version-numbers.json +1 -0
  181. package/data/problems/complete-binary-tree-inserter.json +1 -0
  182. package/data/problems/complex-number-multiplication.json +1 -0
  183. package/data/problems/concatenated-words.json +1 -0
  184. package/data/problems/concatenation-of-array.json +1 -0
  185. package/data/problems/consecutive-numbers-sum.json +1 -0
  186. package/data/problems/construct-binary-tree-from-inorder-and-postorder-traversal.json +1 -0
  187. package/data/problems/construct-binary-tree-from-preorder-and-inorder-traversal.json +1 -0
  188. package/data/problems/construct-binary-tree-from-preorder-and-postorder-traversal.json +1 -0
  189. package/data/problems/construct-binary-tree-from-string.json +1 -0
  190. package/data/problems/construct-quad-tree.json +1 -0
  191. package/data/problems/construct-string-from-binary-tree.json +1 -0
  192. package/data/problems/construct-the-rectangle.json +1 -0
  193. package/data/problems/contain-virus.json +1 -0
  194. package/data/problems/container-with-most-water.json +1 -0
  195. package/data/problems/contains-duplicate-ii.json +1 -0
  196. package/data/problems/contains-duplicate-iii.json +1 -0
  197. package/data/problems/contains-duplicate.json +1 -0
  198. package/data/problems/contiguous-array.json +1 -0
  199. package/data/problems/continuous-subarray-sum.json +1 -0
  200. package/data/problems/convert-a-number-to-hexadecimal.json +1 -0
  201. package/data/problems/convert-binary-search-tree-to-sorted-doubly-linked-list.json +1 -0
  202. package/data/problems/convert-bst-to-greater-tree.json +1 -0
  203. package/data/problems/convert-sorted-array-to-binary-search-tree.json +1 -0
  204. package/data/problems/convert-sorted-list-to-binary-search-tree.json +1 -0
  205. package/data/problems/convex-polygon.json +1 -0
  206. package/data/problems/copy-list-with-random-pointer.json +1 -0
  207. package/data/problems/count-and-say.json +1 -0
  208. package/data/problems/count-binary-substrings.json +1 -0
  209. package/data/problems/count-complete-tree-nodes.json +1 -0
  210. package/data/problems/count-different-palindromic-subsequences.json +1 -0
  211. package/data/problems/count-good-nodes-in-binary-tree.json +1 -0
  212. package/data/problems/count-numbers-with-unique-digits.json +1 -0
  213. package/data/problems/count-of-range-sum.json +1 -0
  214. package/data/problems/count-of-smaller-numbers-after-self.json +1 -0
  215. package/data/problems/count-primes.json +1 -0
  216. package/data/problems/count-the-repetitions.json +1 -0
  217. package/data/problems/count-unique-characters-of-all-substrings-of-a-given-string.json +1 -0
  218. package/data/problems/count-univalue-subtrees.json +1 -0
  219. package/data/problems/counting-bits.json +1 -0
  220. package/data/problems/couples-holding-hands.json +1 -0
  221. package/data/problems/course-schedule-ii.json +1 -0
  222. package/data/problems/course-schedule-iii.json +1 -0
  223. package/data/problems/course-schedule-iv.json +1 -0
  224. package/data/problems/course-schedule.json +1 -0
  225. package/data/problems/cousins-in-binary-tree.json +1 -0
  226. package/data/problems/cracking-the-safe.json +1 -0
  227. package/data/problems/create-maximum-number.json +1 -0
  228. package/data/problems/custom-sort-string.json +1 -0
  229. package/data/problems/cut-off-trees-for-golf-event.json +1 -0
  230. package/data/problems/daily-temperatures.json +1 -0
  231. package/data/problems/data-stream-as-disjoint-intervals.json +1 -0
  232. package/data/problems/decode-string.json +1 -0
  233. package/data/problems/decode-ways-ii.json +1 -0
  234. package/data/problems/decode-ways.json +1 -0
  235. package/data/problems/decoded-string-at-index.json +1 -0
  236. package/data/problems/degree-of-an-array.json +1 -0
  237. package/data/problems/delete-and-earn.json +1 -0
  238. package/data/problems/delete-columns-to-make-sorted-ii.json +1 -0
  239. package/data/problems/delete-columns-to-make-sorted-iii.json +1 -0
  240. package/data/problems/delete-columns-to-make-sorted.json +1 -0
  241. package/data/problems/delete-leaves-with-a-given-value.json +1 -0
  242. package/data/problems/delete-node-in-a-bst.json +1 -0
  243. package/data/problems/delete-node-in-a-linked-list.json +1 -0
  244. package/data/problems/delete-operation-for-two-strings.json +1 -0
  245. package/data/problems/design-add-and-search-words-data-structure.json +1 -0
  246. package/data/problems/design-circular-deque.json +1 -0
  247. package/data/problems/design-circular-queue.json +1 -0
  248. package/data/problems/design-compressed-string-iterator.json +1 -0
  249. package/data/problems/design-excel-sum-formula.json +1 -0
  250. package/data/problems/design-hashmap.json +1 -0
  251. package/data/problems/design-hashset.json +1 -0
  252. package/data/problems/design-hit-counter.json +1 -0
  253. package/data/problems/design-in-memory-file-system.json +1 -0
  254. package/data/problems/design-linked-list.json +1 -0
  255. package/data/problems/design-log-storage-system.json +1 -0
  256. package/data/problems/design-phone-directory.json +1 -0
  257. package/data/problems/design-search-autocomplete-system.json +1 -0
  258. package/data/problems/design-snake-game.json +1 -0
  259. package/data/problems/design-tic-tac-toe.json +1 -0
  260. package/data/problems/design-twitter.json +1 -0
  261. package/data/problems/detect-capital.json +1 -0
  262. package/data/problems/detect-squares.json +1 -0
  263. package/data/problems/di-string-match.json +1 -0
  264. package/data/problems/diagonal-traverse.json +1 -0
  265. package/data/problems/diameter-of-binary-tree.json +1 -0
  266. package/data/problems/different-ways-to-add-parentheses.json +1 -0
  267. package/data/problems/distinct-subsequences-ii.json +1 -0
  268. package/data/problems/distinct-subsequences.json +1 -0
  269. package/data/problems/distribute-candies.json +1 -0
  270. package/data/problems/distribute-coins-in-binary-tree.json +1 -0
  271. package/data/problems/divide-two-integers.json +1 -0
  272. package/data/problems/domino-and-tromino-tiling.json +1 -0
  273. package/data/problems/dota2-senate.json +1 -0
  274. package/data/problems/dungeon-game.json +1 -0
  275. package/data/problems/edit-distance.json +1 -0
  276. package/data/problems/elimination-game.json +1 -0
  277. package/data/problems/employee-free-time.json +1 -0
  278. package/data/problems/employee-importance.json +1 -0
  279. package/data/problems/encode-and-decode-strings.json +1 -0
  280. package/data/problems/encode-and-decode-tinyurl.json +1 -0
  281. package/data/problems/encode-n-ary-tree-to-binary-tree.json +1 -0
  282. package/data/problems/encode-string-with-shortest-length.json +1 -0
  283. package/data/problems/equal-rational-numbers.json +1 -0
  284. package/data/problems/equal-tree-partition.json +1 -0
  285. package/data/problems/erect-the-fence.json +1 -0
  286. package/data/problems/escape-the-ghosts.json +1 -0
  287. package/data/problems/evaluate-division.json +1 -0
  288. package/data/problems/evaluate-reverse-polish-notation.json +1 -0
  289. package/data/problems/exam-room.json +1 -0
  290. package/data/problems/excel-sheet-column-number.json +1 -0
  291. package/data/problems/excel-sheet-column-title.json +1 -0
  292. package/data/problems/exclusive-time-of-functions.json +1 -0
  293. package/data/problems/expression-add-operators.json +1 -0
  294. package/data/problems/expressive-words.json +1 -0
  295. package/data/problems/extra-characters-in-a-string.json +1 -0
  296. package/data/problems/factor-combinations.json +1 -0
  297. package/data/problems/factorial-trailing-zeroes.json +1 -0
  298. package/data/problems/fair-candy-swap.json +1 -0
  299. package/data/problems/falling-squares.json +1 -0
  300. package/data/problems/fibonacci-number.json +1 -0
  301. package/data/problems/find-all-anagrams-in-a-string.json +1 -0
  302. package/data/problems/find-all-duplicates-in-an-array.json +1 -0
  303. package/data/problems/find-all-numbers-disappeared-in-an-array.json +1 -0
  304. package/data/problems/find-anagram-mappings.json +1 -0
  305. package/data/problems/find-and-replace-in-string.json +1 -0
  306. package/data/problems/find-and-replace-pattern.json +1 -0
  307. package/data/problems/find-bottom-left-tree-value.json +1 -0
  308. package/data/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree.json +1 -0
  309. package/data/problems/find-duplicate-file-in-system.json +1 -0
  310. package/data/problems/find-duplicate-subtrees.json +1 -0
  311. package/data/problems/find-eventual-safe-states.json +1 -0
  312. package/data/problems/find-first-and-last-position-of-element-in-sorted-array.json +1 -0
  313. package/data/problems/find-in-mountain-array.json +1 -0
  314. package/data/problems/find-k-closest-elements.json +1 -0
  315. package/data/problems/find-k-pairs-with-smallest-sums.json +1 -0
  316. package/data/problems/find-k-th-smallest-pair-distance.json +1 -0
  317. package/data/problems/find-largest-value-in-each-tree-row.json +1 -0
  318. package/data/problems/find-leaves-of-binary-tree.json +1 -0
  319. package/data/problems/find-median-from-data-stream.json +1 -0
  320. package/data/problems/find-minimum-in-rotated-sorted-array-ii.json +1 -0
  321. package/data/problems/find-minimum-in-rotated-sorted-array.json +1 -0
  322. package/data/problems/find-mode-in-binary-search-tree.json +1 -0
  323. package/data/problems/find-peak-element.json +1 -0
  324. package/data/problems/find-permutation.json +1 -0
  325. package/data/problems/find-pivot-index.json +1 -0
  326. package/data/problems/find-right-interval.json +1 -0
  327. package/data/problems/find-smallest-letter-greater-than-target.json +1 -0
  328. package/data/problems/find-the-celebrity.json +1 -0
  329. package/data/problems/find-the-closest-palindrome.json +1 -0
  330. package/data/problems/find-the-derangement-of-an-array.json +1 -0
  331. package/data/problems/find-the-difference.json +1 -0
  332. package/data/problems/find-the-duplicate-number.json +1 -0
  333. package/data/problems/find-the-index-of-the-first-occurrence-in-a-string.json +1 -0
  334. package/data/problems/find-the-shortest-superstring.json +1 -0
  335. package/data/problems/find-the-town-judge.json +1 -0
  336. package/data/problems/first-bad-version.json +1 -0
  337. package/data/problems/first-missing-positive.json +1 -0
  338. package/data/problems/first-unique-character-in-a-string.json +1 -0
  339. package/data/problems/fizz-buzz.json +1 -0
  340. package/data/problems/flatten-2d-vector.json +1 -0
  341. package/data/problems/flatten-a-multilevel-doubly-linked-list.json +1 -0
  342. package/data/problems/flatten-binary-tree-to-linked-list.json +1 -0
  343. package/data/problems/flatten-nested-list-iterator.json +1 -0
  344. package/data/problems/flip-binary-tree-to-match-preorder-traversal.json +1 -0
  345. package/data/problems/flip-equivalent-binary-trees.json +1 -0
  346. package/data/problems/flip-game-ii.json +1 -0
  347. package/data/problems/flip-game.json +1 -0
  348. package/data/problems/flip-string-to-monotone-increasing.json +1 -0
  349. package/data/problems/flipping-an-image.json +1 -0
  350. package/data/problems/flood-fill.json +1 -0
  351. package/data/problems/fraction-addition-and-subtraction.json +1 -0
  352. package/data/problems/fraction-to-recurring-decimal.json +1 -0
  353. package/data/problems/freedom-trail.json +1 -0
  354. package/data/problems/friends-of-appropriate-ages.json +1 -0
  355. package/data/problems/frog-jump.json +1 -0
  356. package/data/problems/fruit-into-baskets.json +1 -0
  357. package/data/problems/game-of-life.json +1 -0
  358. package/data/problems/gas-station.json +1 -0
  359. package/data/problems/generalized-abbreviation.json +1 -0
  360. package/data/problems/generate-parentheses.json +1 -0
  361. package/data/problems/generate-random-point-in-a-circle.json +1 -0
  362. package/data/problems/global-and-local-inversions.json +1 -0
  363. package/data/problems/goat-latin.json +1 -0
  364. package/data/problems/graph-valid-tree.json +1 -0
  365. package/data/problems/gray-code.json +1 -0
  366. package/data/problems/greatest-common-divisor-of-strings.json +1 -0
  367. package/data/problems/greatest-common-divisor-traversal.json +1 -0
  368. package/data/problems/group-anagrams.json +1 -0
  369. package/data/problems/group-shifted-strings.json +1 -0
  370. package/data/problems/groups-of-special-equivalent-strings.json +1 -0
  371. package/data/problems/guess-number-higher-or-lower-ii.json +1 -0
  372. package/data/problems/guess-number-higher-or-lower.json +1 -0
  373. package/data/problems/guess-the-word.json +1 -0
  374. package/data/problems/h-index-ii.json +1 -0
  375. package/data/problems/h-index.json +1 -0
  376. package/data/problems/hamming-distance.json +1 -0
  377. package/data/problems/hand-of-straights.json +1 -0
  378. package/data/problems/happy-number.json +1 -0
  379. package/data/problems/heaters.json +1 -0
  380. package/data/problems/house-robber-ii.json +1 -0
  381. package/data/problems/house-robber-iii.json +1 -0
  382. package/data/problems/house-robber.json +1 -0
  383. package/data/problems/image-overlap.json +1 -0
  384. package/data/problems/image-smoother.json +1 -0
  385. package/data/problems/implement-magic-dictionary.json +1 -0
  386. package/data/problems/implement-queue-using-stacks.json +1 -0
  387. package/data/problems/implement-rand10-using-rand7.json +1 -0
  388. package/data/problems/implement-stack-using-queues.json +1 -0
  389. package/data/problems/implement-trie-prefix-tree.json +1 -0
  390. package/data/problems/increasing-order-search-tree.json +1 -0
  391. package/data/problems/increasing-triplet-subsequence.json +1 -0
  392. package/data/problems/inorder-successor-in-bst-ii.json +1 -0
  393. package/data/problems/inorder-successor-in-bst.json +1 -0
  394. package/data/problems/insert-delete-getrandom-o1-duplicates-allowed.json +1 -0
  395. package/data/problems/insert-delete-getrandom-o1.json +1 -0
  396. package/data/problems/insert-greatest-common-divisors-in-linked-list.json +1 -0
  397. package/data/problems/insert-interval.json +1 -0
  398. package/data/problems/insert-into-a-binary-search-tree.json +1 -0
  399. package/data/problems/insert-into-a-sorted-circular-linked-list.json +1 -0
  400. package/data/problems/insertion-sort-list.json +1 -0
  401. package/data/problems/integer-break.json +1 -0
  402. package/data/problems/integer-replacement.json +1 -0
  403. package/data/problems/integer-to-english-words.json +1 -0
  404. package/data/problems/integer-to-roman.json +1 -0
  405. package/data/problems/interleaving-string.json +1 -0
  406. package/data/problems/intersection-of-two-arrays-ii.json +1 -0
  407. package/data/problems/intersection-of-two-arrays.json +1 -0
  408. package/data/problems/intersection-of-two-linked-lists.json +1 -0
  409. package/data/problems/interval-list-intersections.json +1 -0
  410. package/data/problems/invert-binary-tree.json +1 -0
  411. package/data/problems/ip-to-cidr.json +1 -0
  412. package/data/problems/ipo.json +1 -0
  413. package/data/problems/is-graph-bipartite.json +1 -0
  414. package/data/problems/is-subsequence.json +1 -0
  415. package/data/problems/island-perimeter.json +1 -0
  416. package/data/problems/isomorphic-strings.json +1 -0
  417. package/data/problems/jewels-and-stones.json +1 -0
  418. package/data/problems/jump-game-ii.json +1 -0
  419. package/data/problems/jump-game-vii.json +1 -0
  420. package/data/problems/jump-game.json +1 -0
  421. package/data/problems/k-closest-points-to-origin.json +1 -0
  422. package/data/problems/k-diff-pairs-in-an-array.json +1 -0
  423. package/data/problems/k-empty-slots.json +1 -0
  424. package/data/problems/k-inverse-pairs-array.json +1 -0
  425. package/data/problems/k-similar-strings.json +1 -0
  426. package/data/problems/k-th-smallest-in-lexicographical-order.json +1 -0
  427. package/data/problems/k-th-smallest-prime-fraction.json +1 -0
  428. package/data/problems/k-th-symbol-in-grammar.json +1 -0
  429. package/data/problems/keyboard-row.json +1 -0
  430. package/data/problems/keys-and-rooms.json +1 -0
  431. package/data/problems/kill-process.json +1 -0
  432. package/data/problems/knight-dialer.json +1 -0
  433. package/data/problems/knight-probability-in-chessboard.json +1 -0
  434. package/data/problems/koko-eating-bananas.json +1 -0
  435. package/data/problems/kth-largest-element-in-a-stream.json +1 -0
  436. package/data/problems/kth-largest-element-in-an-array.json +1 -0
  437. package/data/problems/kth-smallest-element-in-a-bst.json +1 -0
  438. package/data/problems/kth-smallest-element-in-a-sorted-matrix.json +1 -0
  439. package/data/problems/kth-smallest-number-in-multiplication-table.json +1 -0
  440. package/data/problems/largest-bst-subtree.json +1 -0
  441. package/data/problems/largest-component-size-by-common-factor.json +1 -0
  442. package/data/problems/largest-divisible-subset.json +1 -0
  443. package/data/problems/largest-number-at-least-twice-of-others.json +1 -0
  444. package/data/problems/largest-number.json +1 -0
  445. package/data/problems/largest-palindrome-product.json +1 -0
  446. package/data/problems/largest-perimeter-triangle.json +1 -0
  447. package/data/problems/largest-plus-sign.json +1 -0
  448. package/data/problems/largest-rectangle-in-histogram.json +1 -0
  449. package/data/problems/largest-sum-of-averages.json +1 -0
  450. package/data/problems/largest-time-for-given-digits.json +1 -0
  451. package/data/problems/largest-triangle-area.json +1 -0
  452. package/data/problems/last-stone-weight-ii.json +1 -0
  453. package/data/problems/last-stone-weight.json +1 -0
  454. package/data/problems/leaf-similar-trees.json +1 -0
  455. package/data/problems/least-operators-to-express-number.json +1 -0
  456. package/data/problems/lemonade-change.json +1 -0
  457. package/data/problems/length-of-last-word.json +1 -0
  458. package/data/problems/length-of-longest-fibonacci-subsequence.json +1 -0
  459. package/data/problems/letter-case-permutation.json +1 -0
  460. package/data/problems/letter-combinations-of-a-phone-number.json +1 -0
  461. package/data/problems/lexicographical-numbers.json +1 -0
  462. package/data/problems/lfu-cache.json +1 -0
  463. package/data/problems/license-key-formatting.json +1 -0
  464. package/data/problems/line-reflection.json +1 -0
  465. package/data/problems/linked-list-components.json +1 -0
  466. package/data/problems/linked-list-cycle-ii.json +1 -0
  467. package/data/problems/linked-list-cycle.json +1 -0
  468. package/data/problems/linked-list-random-node.json +1 -0
  469. package/data/problems/logger-rate-limiter.json +1 -0
  470. package/data/problems/logical-or-of-two-binary-grids-represented-as-quad-trees.json +1 -0
  471. package/data/problems/lonely-pixel-i.json +1 -0
  472. package/data/problems/lonely-pixel-ii.json +1 -0
  473. package/data/problems/long-pressed-name.json +1 -0
  474. package/data/problems/longest-absolute-file-path.json +1 -0
  475. package/data/problems/longest-common-prefix.json +1 -0
  476. package/data/problems/longest-common-subsequence.json +1 -0
  477. package/data/problems/longest-consecutive-sequence.json +1 -0
  478. package/data/problems/longest-continuous-increasing-subsequence.json +1 -0
  479. package/data/problems/longest-happy-string.json +1 -0
  480. package/data/problems/longest-harmonious-subsequence.json +1 -0
  481. package/data/problems/longest-increasing-path-in-a-matrix.json +1 -0
  482. package/data/problems/longest-increasing-subsequence.json +1 -0
  483. package/data/problems/longest-line-of-consecutive-one-in-matrix.json +1 -0
  484. package/data/problems/longest-mountain-in-array.json +1 -0
  485. package/data/problems/longest-palindrome.json +1 -0
  486. package/data/problems/longest-palindromic-subsequence.json +1 -0
  487. package/data/problems/longest-palindromic-substring.json +1 -0
  488. package/data/problems/longest-repeating-character-replacement.json +1 -0
  489. package/data/problems/longest-substring-with-at-least-k-repeating-characters.json +1 -0
  490. package/data/problems/longest-substring-with-at-most-k-distinct-characters.json +1 -0
  491. package/data/problems/longest-substring-with-at-most-two-distinct-characters.json +1 -0
  492. package/data/problems/longest-substring-without-repeating-characters.json +1 -0
  493. package/data/problems/longest-turbulent-subarray.json +1 -0
  494. package/data/problems/longest-uncommon-subsequence-i.json +1 -0
  495. package/data/problems/longest-uncommon-subsequence-ii.json +1 -0
  496. package/data/problems/longest-univalue-path.json +1 -0
  497. package/data/problems/longest-valid-parentheses.json +1 -0
  498. package/data/problems/longest-word-in-dictionary-through-deleting.json +1 -0
  499. package/data/problems/longest-word-in-dictionary.json +1 -0
  500. package/data/problems/loud-and-rich.json +1 -0
  501. package/data/problems/lowest-common-ancestor-of-a-binary-search-tree.json +1 -0
  502. package/data/problems/lowest-common-ancestor-of-a-binary-tree.json +1 -0
  503. package/data/problems/lru-cache.json +1 -0
  504. package/data/problems/magic-squares-in-grid.json +1 -0
  505. package/data/problems/magical-string.json +1 -0
  506. package/data/problems/majority-element-ii.json +1 -0
  507. package/data/problems/majority-element.json +1 -0
  508. package/data/problems/making-a-large-island.json +1 -0
  509. package/data/problems/map-sum-pairs.json +1 -0
  510. package/data/problems/masking-personal-information.json +1 -0
  511. package/data/problems/matchsticks-to-square.json +1 -0
  512. package/data/problems/max-area-of-island.json +1 -0
  513. package/data/problems/max-chunks-to-make-sorted-ii.json +1 -0
  514. package/data/problems/max-chunks-to-make-sorted.json +1 -0
  515. package/data/problems/max-consecutive-ones-ii.json +1 -0
  516. package/data/problems/max-consecutive-ones.json +1 -0
  517. package/data/problems/max-increase-to-keep-city-skyline.json +1 -0
  518. package/data/problems/max-points-on-a-line.json +1 -0
  519. package/data/problems/max-stack.json +1 -0
  520. package/data/problems/max-sum-of-rectangle-no-larger-than-k.json +1 -0
  521. package/data/problems/maximal-rectangle.json +1 -0
  522. package/data/problems/maximal-square.json +1 -0
  523. package/data/problems/maximize-distance-to-closest-person.json +1 -0
  524. package/data/problems/maximum-average-subarray-i.json +1 -0
  525. package/data/problems/maximum-average-subarray-ii.json +1 -0
  526. package/data/problems/maximum-binary-tree-ii.json +1 -0
  527. package/data/problems/maximum-binary-tree.json +1 -0
  528. package/data/problems/maximum-depth-of-binary-tree.json +1 -0
  529. package/data/problems/maximum-depth-of-n-ary-tree.json +1 -0
  530. package/data/problems/maximum-distance-in-arrays.json +1 -0
  531. package/data/problems/maximum-frequency-stack.json +1 -0
  532. package/data/problems/maximum-gap.json +1 -0
  533. package/data/problems/maximum-length-of-pair-chain.json +1 -0
  534. package/data/problems/maximum-length-of-repeated-subarray.json +1 -0
  535. package/data/problems/maximum-product-of-three-numbers.json +1 -0
  536. package/data/problems/maximum-product-of-word-lengths.json +1 -0
  537. package/data/problems/maximum-product-subarray.json +1 -0
  538. package/data/problems/maximum-size-subarray-sum-equals-k.json +1 -0
  539. package/data/problems/maximum-subarray.json +1 -0
  540. package/data/problems/maximum-sum-circular-subarray.json +1 -0
  541. package/data/problems/maximum-sum-of-3-non-overlapping-subarrays.json +1 -0
  542. package/data/problems/maximum-swap.json +1 -0
  543. package/data/problems/maximum-vacation-days.json +1 -0
  544. package/data/problems/maximum-width-of-binary-tree.json +1 -0
  545. package/data/problems/maximum-width-ramp.json +1 -0
  546. package/data/problems/maximum-xor-of-two-numbers-in-an-array.json +1 -0
  547. package/data/problems/median-of-two-sorted-arrays.json +1 -0
  548. package/data/problems/meeting-rooms-ii.json +1 -0
  549. package/data/problems/meeting-rooms-iii.json +1 -0
  550. package/data/problems/meeting-rooms.json +1 -0
  551. package/data/problems/merge-intervals.json +1 -0
  552. package/data/problems/merge-k-sorted-lists.json +1 -0
  553. package/data/problems/merge-sorted-array.json +1 -0
  554. package/data/problems/merge-strings-alternately.json +1 -0
  555. package/data/problems/merge-triplets-to-form-target-triplet.json +1 -0
  556. package/data/problems/merge-two-binary-trees.json +1 -0
  557. package/data/problems/merge-two-sorted-lists.json +1 -0
  558. package/data/problems/middle-of-the-linked-list.json +1 -0
  559. package/data/problems/min-cost-climbing-stairs.json +1 -0
  560. package/data/problems/min-cost-to-connect-all-points.json +1 -0
  561. package/data/problems/min-stack.json +1 -0
  562. package/data/problems/minesweeper.json +1 -0
  563. package/data/problems/mini-parser.json +1 -0
  564. package/data/problems/minimize-malware-spread-ii.json +1 -0
  565. package/data/problems/minimize-malware-spread.json +1 -0
  566. package/data/problems/minimize-max-distance-to-gas-station.json +1 -0
  567. package/data/problems/minimum-absolute-difference-in-bst.json +1 -0
  568. package/data/problems/minimum-add-to-make-parentheses-valid.json +1 -0
  569. package/data/problems/minimum-area-rectangle-ii.json +1 -0
  570. package/data/problems/minimum-area-rectangle.json +1 -0
  571. package/data/problems/minimum-array-end.json +1 -0
  572. package/data/problems/minimum-ascii-delete-sum-for-two-strings.json +1 -0
  573. package/data/problems/minimum-cost-for-tickets.json +1 -0
  574. package/data/problems/minimum-cost-to-hire-k-workers.json +1 -0
  575. package/data/problems/minimum-cost-to-merge-stones.json +1 -0
  576. package/data/problems/minimum-depth-of-binary-tree.json +1 -0
  577. package/data/problems/minimum-distance-between-bst-nodes.json +1 -0
  578. package/data/problems/minimum-factorization.json +1 -0
  579. package/data/problems/minimum-falling-path-sum.json +1 -0
  580. package/data/problems/minimum-genetic-mutation.json +1 -0
  581. package/data/problems/minimum-height-trees.json +1 -0
  582. package/data/problems/minimum-increment-to-make-array-unique.json +1 -0
  583. package/data/problems/minimum-index-sum-of-two-lists.json +1 -0
  584. package/data/problems/minimum-interval-to-include-each-query.json +1 -0
  585. package/data/problems/minimum-moves-to-equal-array-elements-ii.json +1 -0
  586. package/data/problems/minimum-moves-to-equal-array-elements.json +1 -0
  587. package/data/problems/minimum-number-of-arrows-to-burst-balloons.json +1 -0
  588. package/data/problems/minimum-number-of-k-consecutive-bit-flips.json +1 -0
  589. package/data/problems/minimum-number-of-refueling-stops.json +1 -0
  590. package/data/problems/minimum-path-sum.json +1 -0
  591. package/data/problems/minimum-size-subarray-sum.json +1 -0
  592. package/data/problems/minimum-swaps-to-make-sequences-increasing.json +1 -0
  593. package/data/problems/minimum-time-difference.json +1 -0
  594. package/data/problems/minimum-unique-word-abbreviation.json +1 -0
  595. package/data/problems/minimum-window-subsequence.json +1 -0
  596. package/data/problems/minimum-window-substring.json +1 -0
  597. package/data/problems/mirror-reflection.json +1 -0
  598. package/data/problems/missing-number.json +1 -0
  599. package/data/problems/missing-ranges.json +1 -0
  600. package/data/problems/monotone-increasing-digits.json +1 -0
  601. package/data/problems/monotonic-array.json +1 -0
  602. package/data/problems/most-common-word.json +1 -0
  603. package/data/problems/most-frequent-subtree-sum.json +1 -0
  604. package/data/problems/most-profit-assigning-work.json +1 -0
  605. package/data/problems/most-stones-removed-with-same-row-or-column.json +1 -0
  606. package/data/problems/move-zeroes.json +1 -0
  607. package/data/problems/moving-average-from-data-stream.json +1 -0
  608. package/data/problems/multiply-strings.json +1 -0
  609. package/data/problems/my-calendar-i.json +1 -0
  610. package/data/problems/my-calendar-ii.json +1 -0
  611. package/data/problems/my-calendar-iii.json +1 -0
  612. package/data/problems/n-ary-tree-level-order-traversal.json +1 -0
  613. package/data/problems/n-ary-tree-postorder-traversal.json +1 -0
  614. package/data/problems/n-ary-tree-preorder-traversal.json +1 -0
  615. package/data/problems/n-queens-ii.json +1 -0
  616. package/data/problems/n-queens.json +1 -0
  617. package/data/problems/n-repeated-element-in-size-2n-array.json +1 -0
  618. package/data/problems/n-th-tribonacci-number.json +1 -0
  619. package/data/problems/nested-list-weight-sum-ii.json +1 -0
  620. package/data/problems/nested-list-weight-sum.json +1 -0
  621. package/data/problems/network-delay-time.json +1 -0
  622. package/data/problems/new-21-game.json +1 -0
  623. package/data/problems/next-closest-time.json +1 -0
  624. package/data/problems/next-greater-element-i.json +1 -0
  625. package/data/problems/next-greater-element-ii.json +1 -0
  626. package/data/problems/next-greater-element-iii.json +1 -0
  627. package/data/problems/next-permutation.json +1 -0
  628. package/data/problems/nim-game.json +1 -0
  629. package/data/problems/non-decreasing-array.json +1 -0
  630. package/data/problems/non-decreasing-subsequences.json +1 -0
  631. package/data/problems/non-negative-integers-without-consecutive-ones.json +1 -0
  632. package/data/problems/non-overlapping-intervals.json +1 -0
  633. package/data/problems/nth-digit.json +1 -0
  634. package/data/problems/nth-magical-number.json +1 -0
  635. package/data/problems/number-complement.json +1 -0
  636. package/data/problems/number-of-1-bits.json +1 -0
  637. package/data/problems/number-of-atoms.json +1 -0
  638. package/data/problems/number-of-boomerangs.json +1 -0
  639. package/data/problems/number-of-connected-components-in-an-undirected-graph.json +1 -0
  640. package/data/problems/number-of-corner-rectangles.json +1 -0
  641. package/data/problems/number-of-digit-one.json +1 -0
  642. package/data/problems/number-of-distinct-islands-ii.json +1 -0
  643. package/data/problems/number-of-distinct-islands.json +1 -0
  644. package/data/problems/number-of-islands-ii.json +1 -0
  645. package/data/problems/number-of-islands.json +1 -0
  646. package/data/problems/number-of-lines-to-write-string.json +1 -0
  647. package/data/problems/number-of-longest-increasing-subsequence.json +1 -0
  648. package/data/problems/number-of-matching-subsequences.json +1 -0
  649. package/data/problems/number-of-music-playlists.json +1 -0
  650. package/data/problems/number-of-provinces.json +1 -0
  651. package/data/problems/number-of-recent-calls.json +1 -0
  652. package/data/problems/number-of-segments-in-a-string.json +1 -0
  653. package/data/problems/number-of-squareful-arrays.json +1 -0
  654. package/data/problems/number-of-subarrays-with-bounded-maximum.json +1 -0
  655. package/data/problems/numbers-at-most-n-given-digit-set.json +1 -0
  656. package/data/problems/numbers-with-same-consecutive-differences.json +1 -0
  657. package/data/problems/odd-even-jump.json +1 -0
  658. package/data/problems/odd-even-linked-list.json +1 -0
  659. package/data/problems/one-edit-distance.json +1 -0
  660. package/data/problems/ones-and-zeroes.json +1 -0
  661. package/data/problems/online-election.json +1 -0
  662. package/data/problems/online-stock-span.json +1 -0
  663. package/data/problems/open-the-lock.json +1 -0
  664. package/data/problems/optimal-account-balancing.json +1 -0
  665. package/data/problems/optimal-division.json +1 -0
  666. package/data/problems/orderly-queue.json +1 -0
  667. package/data/problems/out-of-boundary-paths.json +1 -0
  668. package/data/problems/output-contest-matches.json +1 -0
  669. package/data/problems/pacific-atlantic-water-flow.json +1 -0
  670. package/data/problems/paint-fence.json +1 -0
  671. package/data/problems/paint-house-ii.json +1 -0
  672. package/data/problems/paint-house.json +1 -0
  673. package/data/problems/palindrome-linked-list.json +1 -0
  674. package/data/problems/palindrome-number.json +1 -0
  675. package/data/problems/palindrome-pairs.json +1 -0
  676. package/data/problems/palindrome-partitioning-ii.json +1 -0
  677. package/data/problems/palindrome-partitioning.json +1 -0
  678. package/data/problems/palindrome-permutation-ii.json +1 -0
  679. package/data/problems/palindrome-permutation.json +1 -0
  680. package/data/problems/palindromic-substrings.json +1 -0
  681. package/data/problems/pancake-sorting.json +1 -0
  682. package/data/problems/parse-lisp-expression.json +1 -0
  683. package/data/problems/partition-array-into-disjoint-intervals.json +1 -0
  684. package/data/problems/partition-equal-subset-sum.json +1 -0
  685. package/data/problems/partition-labels.json +1 -0
  686. package/data/problems/partition-list.json +1 -0
  687. package/data/problems/partition-to-k-equal-sum-subsets.json +1 -0
  688. package/data/problems/pascals-triangle-ii.json +1 -0
  689. package/data/problems/pascals-triangle.json +1 -0
  690. package/data/problems/patching-array.json +1 -0
  691. package/data/problems/path-sum-ii.json +1 -0
  692. package/data/problems/path-sum-iii.json +1 -0
  693. package/data/problems/path-sum-iv.json +1 -0
  694. package/data/problems/path-sum.json +1 -0
  695. package/data/problems/path-with-minimum-effort.json +1 -0
  696. package/data/problems/peak-index-in-a-mountain-array.json +1 -0
  697. package/data/problems/peeking-iterator.json +1 -0
  698. package/data/problems/perfect-number.json +1 -0
  699. package/data/problems/perfect-rectangle.json +1 -0
  700. package/data/problems/perfect-squares.json +1 -0
  701. package/data/problems/permutation-in-string.json +1 -0
  702. package/data/problems/permutation-sequence.json +1 -0
  703. package/data/problems/permutations-ii.json +1 -0
  704. package/data/problems/permutations.json +1 -0
  705. package/data/problems/plus-one-linked-list.json +1 -0
  706. package/data/problems/plus-one.json +1 -0
  707. package/data/problems/poor-pigs.json +1 -0
  708. package/data/problems/populating-next-right-pointers-in-each-node-ii.json +1 -0
  709. package/data/problems/populating-next-right-pointers-in-each-node.json +1 -0
  710. package/data/problems/positions-of-large-groups.json +1 -0
  711. package/data/problems/possible-bipartition.json +1 -0
  712. package/data/problems/pour-water.json +1 -0
  713. package/data/problems/power-of-four.json +1 -0
  714. package/data/problems/power-of-three.json +1 -0
  715. package/data/problems/power-of-two.json +1 -0
  716. package/data/problems/powerful-integers.json +1 -0
  717. package/data/problems/powx-n.json +1 -0
  718. package/data/problems/predict-the-winner.json +1 -0
  719. package/data/problems/prefix-and-suffix-search.json +1 -0
  720. package/data/problems/preimage-size-of-factorial-zeroes-function.json +1 -0
  721. package/data/problems/prime-number-of-set-bits-in-binary-representation.json +1 -0
  722. package/data/problems/prime-palindrome.json +1 -0
  723. package/data/problems/print-binary-tree.json +1 -0
  724. package/data/problems/prison-cells-after-n-days.json +1 -0
  725. package/data/problems/product-of-array-except-self.json +1 -0
  726. package/data/problems/profitable-schemes.json +1 -0
  727. package/data/problems/projection-area-of-3d-shapes.json +1 -0
  728. package/data/problems/push-dominoes.json +1 -0
  729. package/data/problems/pyramid-transition-matrix.json +1 -0
  730. package/data/problems/queue-reconstruction-by-height.json +1 -0
  731. package/data/problems/rabbits-in-forest.json +1 -0
  732. package/data/problems/race-car.json +1 -0
  733. package/data/problems/random-flip-matrix.json +1 -0
  734. package/data/problems/random-pick-index.json +1 -0
  735. package/data/problems/random-pick-with-blacklist.json +1 -0
  736. package/data/problems/random-pick-with-weight.json +1 -0
  737. package/data/problems/random-point-in-non-overlapping-rectangles.json +1 -0
  738. package/data/problems/range-addition-ii.json +1 -0
  739. package/data/problems/range-addition.json +1 -0
  740. package/data/problems/range-module.json +1 -0
  741. package/data/problems/range-sum-of-bst.json +1 -0
  742. package/data/problems/range-sum-query-2d-immutable.json +1 -0
  743. package/data/problems/range-sum-query-2d-mutable.json +1 -0
  744. package/data/problems/range-sum-query-immutable.json +1 -0
  745. package/data/problems/range-sum-query-mutable.json +1 -0
  746. package/data/problems/ransom-note.json +1 -0
  747. package/data/problems/reach-a-number.json +1 -0
  748. package/data/problems/reachable-nodes-in-subdivided-graph.json +1 -0
  749. package/data/problems/reaching-points.json +1 -0
  750. package/data/problems/read-n-characters-given-read4-ii-call-multiple-times.json +1 -0
  751. package/data/problems/read-n-characters-given-read4.json +1 -0
  752. package/data/problems/rearrange-string-k-distance-apart.json +1 -0
  753. package/data/problems/reconstruct-itinerary.json +1 -0
  754. package/data/problems/reconstruct-original-digits-from-english.json +1 -0
  755. package/data/problems/recover-binary-search-tree.json +1 -0
  756. package/data/problems/rectangle-area-ii.json +1 -0
  757. package/data/problems/rectangle-area.json +1 -0
  758. package/data/problems/rectangle-overlap.json +1 -0
  759. package/data/problems/redundant-connection-ii.json +1 -0
  760. package/data/problems/redundant-connection.json +1 -0
  761. package/data/problems/regions-cut-by-slashes.json +1 -0
  762. package/data/problems/regular-expression-matching.json +1 -0
  763. package/data/problems/relative-ranks.json +1 -0
  764. package/data/problems/remove-9.json +1 -0
  765. package/data/problems/remove-boxes.json +1 -0
  766. package/data/problems/remove-comments.json +1 -0
  767. package/data/problems/remove-duplicate-letters.json +1 -0
  768. package/data/problems/remove-duplicates-from-sorted-array-ii.json +1 -0
  769. package/data/problems/remove-duplicates-from-sorted-array.json +1 -0
  770. package/data/problems/remove-duplicates-from-sorted-list-ii.json +1 -0
  771. package/data/problems/remove-duplicates-from-sorted-list.json +1 -0
  772. package/data/problems/remove-element.json +1 -0
  773. package/data/problems/remove-invalid-parentheses.json +1 -0
  774. package/data/problems/remove-k-digits.json +1 -0
  775. package/data/problems/remove-linked-list-elements.json +1 -0
  776. package/data/problems/remove-nth-node-from-end-of-list.json +1 -0
  777. package/data/problems/reorder-data-in-log-files.json +1 -0
  778. package/data/problems/reorder-list.json +1 -0
  779. package/data/problems/reordered-power-of-2.json +1 -0
  780. package/data/problems/reorganize-string.json +1 -0
  781. package/data/problems/repeated-dna-sequences.json +1 -0
  782. package/data/problems/repeated-string-match.json +1 -0
  783. package/data/problems/repeated-substring-pattern.json +1 -0
  784. package/data/problems/replace-words.json +1 -0
  785. package/data/problems/reshape-the-matrix.json +1 -0
  786. package/data/problems/restore-ip-addresses.json +1 -0
  787. package/data/problems/reveal-cards-in-increasing-order.json +1 -0
  788. package/data/problems/reverse-bits.json +1 -0
  789. package/data/problems/reverse-integer.json +1 -0
  790. package/data/problems/reverse-linked-list-ii.json +1 -0
  791. package/data/problems/reverse-linked-list.json +1 -0
  792. package/data/problems/reverse-nodes-in-k-group.json +1 -0
  793. package/data/problems/reverse-only-letters.json +1 -0
  794. package/data/problems/reverse-pairs.json +1 -0
  795. package/data/problems/reverse-string-ii.json +1 -0
  796. package/data/problems/reverse-string.json +1 -0
  797. package/data/problems/reverse-vowels-of-a-string.json +1 -0
  798. package/data/problems/reverse-words-in-a-string-ii.json +1 -0
  799. package/data/problems/reverse-words-in-a-string-iii.json +1 -0
  800. package/data/problems/reverse-words-in-a-string.json +1 -0
  801. package/data/problems/rle-iterator.json +1 -0
  802. package/data/problems/robot-return-to-origin.json +1 -0
  803. package/data/problems/robot-room-cleaner.json +1 -0
  804. package/data/problems/roman-to-integer.json +1 -0
  805. package/data/problems/rotate-array.json +1 -0
  806. package/data/problems/rotate-function.json +1 -0
  807. package/data/problems/rotate-image.json +1 -0
  808. package/data/problems/rotate-list.json +1 -0
  809. package/data/problems/rotate-string.json +1 -0
  810. package/data/problems/rotated-digits.json +1 -0
  811. package/data/problems/rotting-oranges.json +1 -0
  812. package/data/problems/russian-doll-envelopes.json +1 -0
  813. package/data/problems/same-tree.json +1 -0
  814. package/data/problems/satisfiability-of-equality-equations.json +1 -0
  815. package/data/problems/score-after-flipping-matrix.json +1 -0
  816. package/data/problems/score-of-parentheses.json +1 -0
  817. package/data/problems/scramble-string.json +1 -0
  818. package/data/problems/search-a-2d-matrix-ii.json +1 -0
  819. package/data/problems/search-a-2d-matrix.json +1 -0
  820. package/data/problems/search-in-a-binary-search-tree.json +1 -0
  821. package/data/problems/search-in-a-sorted-array-of-unknown-size.json +1 -0
  822. package/data/problems/search-in-rotated-sorted-array-ii.json +1 -0
  823. package/data/problems/search-in-rotated-sorted-array.json +1 -0
  824. package/data/problems/search-insert-position.json +1 -0
  825. package/data/problems/second-minimum-node-in-a-binary-tree.json +1 -0
  826. package/data/problems/self-crossing.json +1 -0
  827. package/data/problems/self-dividing-numbers.json +1 -0
  828. package/data/problems/sentence-screen-fitting.json +1 -0
  829. package/data/problems/sentence-similarity-ii.json +1 -0
  830. package/data/problems/sentence-similarity.json +1 -0
  831. package/data/problems/sequence-reconstruction.json +1 -0
  832. package/data/problems/serialize-and-deserialize-binary-tree.json +1 -0
  833. package/data/problems/serialize-and-deserialize-bst.json +1 -0
  834. package/data/problems/serialize-and-deserialize-n-ary-tree.json +1 -0
  835. package/data/problems/set-intersection-size-at-least-two.json +1 -0
  836. package/data/problems/set-matrix-zeroes.json +1 -0
  837. package/data/problems/set-mismatch.json +1 -0
  838. package/data/problems/shifting-letters.json +1 -0
  839. package/data/problems/shopping-offers.json +1 -0
  840. package/data/problems/short-encoding-of-words.json +1 -0
  841. package/data/problems/shortest-bridge.json +1 -0
  842. package/data/problems/shortest-completing-word.json +1 -0
  843. package/data/problems/shortest-distance-from-all-buildings.json +1 -0
  844. package/data/problems/shortest-distance-to-a-character.json +1 -0
  845. package/data/problems/shortest-palindrome.json +1 -0
  846. package/data/problems/shortest-path-to-get-all-keys.json +1 -0
  847. package/data/problems/shortest-path-visiting-all-nodes.json +1 -0
  848. package/data/problems/shortest-subarray-with-sum-at-least-k.json +1 -0
  849. package/data/problems/shortest-unsorted-continuous-subarray.json +1 -0
  850. package/data/problems/shortest-word-distance-ii.json +1 -0
  851. package/data/problems/shortest-word-distance-iii.json +1 -0
  852. package/data/problems/shortest-word-distance.json +1 -0
  853. package/data/problems/shuffle-an-array.json +1 -0
  854. package/data/problems/similar-rgb-color.json +1 -0
  855. package/data/problems/similar-string-groups.json +1 -0
  856. package/data/problems/simplify-path.json +1 -0
  857. package/data/problems/single-element-in-a-sorted-array.json +1 -0
  858. package/data/problems/single-number-ii.json +1 -0
  859. package/data/problems/single-number-iii.json +1 -0
  860. package/data/problems/single-number.json +1 -0
  861. package/data/problems/single-threaded-cpu.json +1 -0
  862. package/data/problems/sliding-puzzle.json +1 -0
  863. package/data/problems/sliding-window-maximum.json +1 -0
  864. package/data/problems/sliding-window-median.json +1 -0
  865. package/data/problems/smallest-good-base.json +1 -0
  866. package/data/problems/smallest-range-covering-elements-from-k-lists.json +1 -0
  867. package/data/problems/smallest-range-i.json +1 -0
  868. package/data/problems/smallest-range-ii.json +1 -0
  869. package/data/problems/smallest-rectangle-enclosing-black-pixels.json +1 -0
  870. package/data/problems/smallest-rotation-with-highest-score.json +1 -0
  871. package/data/problems/smallest-string-starting-from-leaf.json +1 -0
  872. package/data/problems/smallest-subtree-with-all-the-deepest-nodes.json +1 -0
  873. package/data/problems/snakes-and-ladders.json +1 -0
  874. package/data/problems/solve-the-equation.json +1 -0
  875. package/data/problems/sort-an-array.json +1 -0
  876. package/data/problems/sort-array-by-parity-ii.json +1 -0
  877. package/data/problems/sort-array-by-parity.json +1 -0
  878. package/data/problems/sort-characters-by-frequency.json +1 -0
  879. package/data/problems/sort-colors.json +1 -0
  880. package/data/problems/sort-list.json +1 -0
  881. package/data/problems/sort-transformed-array.json +1 -0
  882. package/data/problems/soup-servings.json +1 -0
  883. package/data/problems/sparse-matrix-multiplication.json +1 -0
  884. package/data/problems/special-binary-string.json +1 -0
  885. package/data/problems/spiral-matrix-ii.json +1 -0
  886. package/data/problems/spiral-matrix-iii.json +1 -0
  887. package/data/problems/spiral-matrix.json +1 -0
  888. package/data/problems/split-array-into-consecutive-subsequences.json +1 -0
  889. package/data/problems/split-array-into-fibonacci-sequence.json +1 -0
  890. package/data/problems/split-array-largest-sum.json +1 -0
  891. package/data/problems/split-array-with-equal-sum.json +1 -0
  892. package/data/problems/split-array-with-same-average.json +1 -0
  893. package/data/problems/split-bst.json +1 -0
  894. package/data/problems/split-concatenated-strings.json +1 -0
  895. package/data/problems/split-linked-list-in-parts.json +1 -0
  896. package/data/problems/sqrtx.json +1 -0
  897. package/data/problems/squares-of-a-sorted-array.json +1 -0
  898. package/data/problems/squirrel-simulation.json +1 -0
  899. package/data/problems/stamping-the-sequence.json +1 -0
  900. package/data/problems/stickers-to-spell-word.json +1 -0
  901. package/data/problems/stone-game-ii.json +1 -0
  902. package/data/problems/stone-game-iii.json +1 -0
  903. package/data/problems/stone-game.json +1 -0
  904. package/data/problems/strange-printer.json +1 -0
  905. package/data/problems/string-compression.json +1 -0
  906. package/data/problems/string-to-integer-atoi.json +1 -0
  907. package/data/problems/string-without-aaa-or-bbb.json +1 -0
  908. package/data/problems/strobogrammatic-number-ii.json +1 -0
  909. package/data/problems/strobogrammatic-number-iii.json +1 -0
  910. package/data/problems/strobogrammatic-number.json +1 -0
  911. package/data/problems/strong-password-checker.json +1 -0
  912. package/data/problems/student-attendance-record-i.json +1 -0
  913. package/data/problems/student-attendance-record-ii.json +1 -0
  914. package/data/problems/subarray-product-less-than-k.json +1 -0
  915. package/data/problems/subarray-sum-equals-k.json +1 -0
  916. package/data/problems/subarray-sums-divisible-by-k.json +1 -0
  917. package/data/problems/subarrays-with-k-different-integers.json +1 -0
  918. package/data/problems/subdomain-visit-count.json +1 -0
  919. package/data/problems/subsets-ii.json +1 -0
  920. package/data/problems/subsets.json +1 -0
  921. package/data/problems/substring-with-concatenation-of-all-words.json +1 -0
  922. package/data/problems/subtree-of-another-tree.json +1 -0
  923. package/data/problems/sudoku-solver.json +1 -0
  924. package/data/problems/sum-of-all-subset-xor-totals.json +1 -0
  925. package/data/problems/sum-of-distances-in-tree.json +1 -0
  926. package/data/problems/sum-of-even-numbers-after-queries.json +1 -0
  927. package/data/problems/sum-of-left-leaves.json +1 -0
  928. package/data/problems/sum-of-square-numbers.json +1 -0
  929. package/data/problems/sum-of-subarray-minimums.json +1 -0
  930. package/data/problems/sum-of-subsequence-widths.json +1 -0
  931. package/data/problems/sum-of-two-integers.json +1 -0
  932. package/data/problems/sum-root-to-leaf-numbers.json +1 -0
  933. package/data/problems/summary-ranges.json +1 -0
  934. package/data/problems/super-egg-drop.json +1 -0
  935. package/data/problems/super-palindromes.json +1 -0
  936. package/data/problems/super-pow.json +1 -0
  937. package/data/problems/super-ugly-number.json +1 -0
  938. package/data/problems/super-washing-machines.json +1 -0
  939. package/data/problems/surface-area-of-3d-shapes.json +1 -0
  940. package/data/problems/surrounded-regions.json +1 -0
  941. package/data/problems/swap-adjacent-in-lr-string.json +1 -0
  942. package/data/problems/swap-nodes-in-pairs.json +1 -0
  943. package/data/problems/swim-in-rising-water.json +1 -0
  944. package/data/problems/symmetric-tree.json +1 -0
  945. package/data/problems/tag-validator.json +1 -0
  946. package/data/problems/tallest-billboard.json +1 -0
  947. package/data/problems/target-sum.json +1 -0
  948. package/data/problems/task-scheduler.json +1 -0
  949. package/data/problems/teemo-attacking.json +1 -0
  950. package/data/problems/ternary-expression-parser.json +1 -0
  951. package/data/problems/text-justification.json +1 -0
  952. package/data/problems/the-maze-ii.json +1 -0
  953. package/data/problems/the-maze-iii.json +1 -0
  954. package/data/problems/the-maze.json +1 -0
  955. package/data/problems/the-skyline-problem.json +1 -0
  956. package/data/problems/third-maximum-number.json +1 -0
  957. package/data/problems/three-equal-parts.json +1 -0
  958. package/data/problems/time-based-key-value-store.json +1 -0
  959. package/data/problems/to-lower-case.json +1 -0
  960. package/data/problems/toeplitz-matrix.json +1 -0
  961. package/data/problems/top-k-frequent-elements.json +1 -0
  962. package/data/problems/top-k-frequent-words.json +1 -0
  963. package/data/problems/total-hamming-distance.json +1 -0
  964. package/data/problems/transform-to-chessboard.json +1 -0
  965. package/data/problems/transpose-matrix.json +1 -0
  966. package/data/problems/trapping-rain-water-ii.json +1 -0
  967. package/data/problems/trapping-rain-water.json +1 -0
  968. package/data/problems/triangle.json +1 -0
  969. package/data/problems/trim-a-binary-search-tree.json +1 -0
  970. package/data/problems/triples-with-bitwise-and-equal-to-zero.json +1 -0
  971. package/data/problems/two-sum-ii-input-array-is-sorted.json +1 -0
  972. package/data/problems/two-sum-iii-data-structure-design.json +1 -0
  973. package/data/problems/two-sum-iv-input-is-a-bst.json +1 -0
  974. package/data/problems/two-sum.json +1 -0
  975. package/data/problems/ugly-number-ii.json +1 -0
  976. package/data/problems/ugly-number.json +1 -0
  977. package/data/problems/uncommon-words-from-two-sentences.json +1 -0
  978. package/data/problems/unique-binary-search-trees-ii.json +1 -0
  979. package/data/problems/unique-binary-search-trees.json +1 -0
  980. package/data/problems/unique-email-addresses.json +1 -0
  981. package/data/problems/unique-morse-code-words.json +1 -0
  982. package/data/problems/unique-paths-ii.json +1 -0
  983. package/data/problems/unique-paths-iii.json +1 -0
  984. package/data/problems/unique-paths.json +1 -0
  985. package/data/problems/unique-substrings-in-wraparound-string.json +1 -0
  986. package/data/problems/unique-word-abbreviation.json +1 -0
  987. package/data/problems/univalued-binary-tree.json +1 -0
  988. package/data/problems/utf-8-validation.json +1 -0
  989. package/data/problems/valid-anagram.json +1 -0
  990. package/data/problems/valid-mountain-array.json +1 -0
  991. package/data/problems/valid-number.json +1 -0
  992. package/data/problems/valid-palindrome-ii.json +1 -0
  993. package/data/problems/valid-palindrome.json +1 -0
  994. package/data/problems/valid-parentheses.json +1 -0
  995. package/data/problems/valid-parenthesis-string.json +1 -0
  996. package/data/problems/valid-perfect-square.json +1 -0
  997. package/data/problems/valid-permutations-for-di-sequence.json +1 -0
  998. package/data/problems/valid-square.json +1 -0
  999. package/data/problems/valid-sudoku.json +1 -0
  1000. package/data/problems/valid-tic-tac-toe-state.json +1 -0
  1001. package/data/problems/valid-triangle-number.json +1 -0
  1002. package/data/problems/valid-word-abbreviation.json +1 -0
  1003. package/data/problems/valid-word-square.json +1 -0
  1004. package/data/problems/validate-binary-search-tree.json +1 -0
  1005. package/data/problems/validate-ip-address.json +1 -0
  1006. package/data/problems/validate-stack-sequences.json +1 -0
  1007. package/data/problems/verify-preorder-sequence-in-binary-search-tree.json +1 -0
  1008. package/data/problems/verify-preorder-serialization-of-a-binary-tree.json +1 -0
  1009. package/data/problems/verifying-an-alien-dictionary.json +1 -0
  1010. package/data/problems/vertical-order-traversal-of-a-binary-tree.json +1 -0
  1011. package/data/problems/vowel-spellchecker.json +1 -0
  1012. package/data/problems/walking-robot-simulation.json +1 -0
  1013. package/data/problems/walls-and-gates.json +1 -0
  1014. package/data/problems/water-and-jug-problem.json +1 -0
  1015. package/data/problems/wiggle-sort-ii.json +1 -0
  1016. package/data/problems/wiggle-sort.json +1 -0
  1017. package/data/problems/wiggle-subsequence.json +1 -0
  1018. package/data/problems/wildcard-matching.json +1 -0
  1019. package/data/problems/word-abbreviation.json +1 -0
  1020. package/data/problems/word-break-ii.json +1 -0
  1021. package/data/problems/word-break.json +1 -0
  1022. package/data/problems/word-ladder-ii.json +1 -0
  1023. package/data/problems/word-ladder.json +1 -0
  1024. package/data/problems/word-pattern-ii.json +1 -0
  1025. package/data/problems/word-pattern.json +1 -0
  1026. package/data/problems/word-search-ii.json +1 -0
  1027. package/data/problems/word-search.json +1 -0
  1028. package/data/problems/word-squares.json +1 -0
  1029. package/data/problems/word-subsets.json +1 -0
  1030. package/data/problems/x-of-a-kind-in-a-deck-of-cards.json +1 -0
  1031. package/data/problems/zigzag-conversion.json +1 -0
  1032. package/data/problems/zigzag-iterator.json +1 -0
  1033. package/data/problems/zuma-game.json +1 -0
  1034. package/dist/cli.js +793 -0
  1035. package/dist/web/assets/index-7tyR3Zsa.js +147 -0
  1036. package/dist/web/assets/index-oer4U46K.css +1 -0
  1037. package/dist/web/index.html +13 -0
  1038. package/package.json +42 -3
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "850", "slug": "k-similar-strings", "id": 850, "title": "K-Similar Strings", "difficulty": "Hard", "category": "string", "link": "https://leetcode.com/problems/k-similar-strings/", "examples": [{"input": "s1 = \"ab\", s2 = \"ba\"", "output": "1", "explanation": "One swap suffices."}, {"input": "s1 = \"abc\", s2 = \"bca\"", "output": "2", "explanation": "Two swaps rotate the letters."}, {"input": "s1 = \"abac\", s2 = \"baca\"", "output": "2", "explanation": "Two swaps align all spots."}], "hints": ["Breadth-first search over strings works: each level is one more swap, and the first visit to s2 is optimal.", "Prune hard: only swap the first mismatched index i with a later j where s1[j] equals s2[i].", "Skip already-seen strings with a visited set to keep the queue small."], "statement": "Count the fewest swaps turning one anagram into another.\n\nStrings `s1` and `s2` hold the same multiset of lowercase letters. In one move you may swap any two positions of `s1`. Return the smallest number of such swaps that rewrites `s1` into `s2`.\n\n**Constraints:**\n- `1 <= s1.length <= 20`\n- `s1.length == s2.length`\n- `s1` and `s2` are anagrams with lowercase letters.\n", "solution": "## Approach\n\nRun breadth-first search from `s1`, where neighbours are swaps fixing the first mismatch. Always swap that index with a later position holding the needed target letter (and not already correct there) to prune heavily. Levels count swaps, so the first arrival at `s2` is minimal; a visited set blocks repeats.\n\n## Complexity Analysis\n\n- **Time Complexity:** Exponential in the worst case but tiny for length up to 20 thanks to pruning; each state fans out to few swaps.\n- **Space Complexity:** O(states) for the queue and visited set.\n\n## Implementation\n\n```python\nfrom collections import deque\nclass Solution:\n def kSimilarity(self, s1: str, s2: str) -> int:\n if s1 == s2:\n return 0\n q = deque([s1])\n seen = {s1}\n steps = 0\n while q:\n steps += 1\n for _ in range(len(q)):\n cur = q.popleft()\n i = 0\n while i < len(cur) and cur[i] == s2[i]:\n i += 1\n lst = list(cur)\n for j in range(i + 1, len(cur)):\n if lst[j] == s2[i] and lst[j] != s2[j]:\n lst[i], lst[j] = lst[j], lst[i]\n nxt = ''.join(lst)\n if nxt == s2:\n return steps\n if nxt not in seen:\n seen.add(nxt)\n q.append(nxt)\n lst[i], lst[j] = lst[j], lst[i]\n return -1\n```\n", "starter": {"go": "package main\n\nfunc KSimilarity(s1 string, s2 string) int {\n return 0\n}", "python": "class Solution:\n def kSimilarity(self, s1: str, s2: str) -> int:\n return 0\n", "cpp": "#include <string>\nusing namespace std;\nclass Solution {\npublic:\n int kSimilarity(string s1, string s2) {\n return 0;\n }\n};"}, "fn": "kSimilarity", "params": [{"name": "s1", "type": "string"}, {"name": "s2", "type": "string"}], "outputType": "int", "tests": [["ab", "ba"], ["abc", "bca"], ["abac", "baca"], ["aabc", "abca"], ["a", "a"], ["ab", "ab"], ["abc", "abc"], ["abc", "acb"], ["abcd", "badc"], ["abcd", "dcba"], ["aabb", "bbaa"], ["abac", "acab"], ["abcde", "edcba"], ["aabbc", "bbcaa"], ["abcab", "bacba"], ["abcdef", "fedcba"], ["aaabbb", "bbbaaa"], ["abcdab", "badcba"], ["abccba", "abccba"], ["abcabc", "cbaabc"], ["aabbcc", "ccbbaa"], ["ab", "ba"], ["aa", "aa"], ["abcd", "abcd"], ["bac", "abc"], ["cba", "abc"], ["abca", "acab"], ["aabb", "abab"]], "expected": [1, 2, 2, 2, 0, 0, 0, 1, 2, 2, 2, 1, 2, 3, 2, 3, 3, 3, 0, 1, 2, 1, 0, 0, 1, 1, 2, 1], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "508", "slug": "k-th-smallest-in-lexicographical-order", "id": 508, "title": "K-th Smallest in Lexicographical Order", "difficulty": "Hard", "category": "trie", "link": "https://leetcode.com/problems/k-th-smallest-in-lexicographical-order/", "examples": [{"input": "n = 13, k = 2", "output": "10", "explanation": "Dictionary order begins 1, 10, 11, 12, 13, 2, .... The second entry is 10."}, {"input": "n = 1, k = 1", "output": "1", "explanation": "Only one value exists."}], "hints": ["Think of numbers as a ten-way tree where children of x are x*10 through x*10+9.", "Count how many values sit under a prefix without visiting each one, then skip whole subtrees or dive deeper.", "Decrease k as you consume prefixes or descend, stopping when k reaches zero."], "statement": "You are given two whole numbers `n` and `k`. Picture all numbers from `1` to `n` written out and then ordered the way words appear in a dictionary (so all numbers starting with `1` come before those starting with `2`, and `10` sits between `1` and `11`).\n\nReturn the `k`-th number in that dictionary ordering, counting from `1`.\n\n**Constraints:**\n- `1 <= k <= n <= 10^9`\n", "solution": "## Approach\n\nView the values as a ten-way tree: the children of `x` are `x*10` through `x*10+9`. Dictionary order is a depth-first walk of this tree. Instead of walking one by one, count how many entries live under a prefix with a helper that sums interval sizes across levels. If the whole subtree fits before `k`, skip it sideways; otherwise go deeper to the first child. Repeat until `k` is consumed.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(log n) jumps, each counting across O(log n) levels.\n- **Space Complexity:** O(1) extra memory.\n\n## Implementation\n\n```python\nclass Solution:\n def findKthNumber(self, n: int, k: int) -> int:\n def steps(p1: int, p2: int) -> int:\n s = 0\n while p1 <= n:\n s += min(n + 1, p2) - p1\n p1 *= 10\n p2 *= 10\n return s\n cur = 1\n k -= 1\n while k > 0:\n c = steps(cur, cur + 1)\n if c <= k:\n cur += 1\n k -= c\n else:\n cur *= 10\n k -= 1\n return cur\n```\n", "starter": {"go": "package main\n\nfunc FindKthNumber(n int, k int) int {\n return 0\n}", "python": "class Solution:\n def findKthNumber(self, n: int, k: int) -> int:\n pass", "cpp": "class Solution {\npublic:\n int findKthNumber(int n, int k) {\n return 0;\n }\n};"}, "fn": "findKthNumber", "params": [{"name": "n", "type": "int"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["13", "2"], ["1", "1"], ["13", "5"], ["13", "1"], ["13", "13"], ["2", "2"], ["10", "10"], ["100", "10"], ["1000", "100"], ["10000", "1000"], ["1000000000", "1000000000"], ["1000000000", "1"], ["9", "9"], ["11", "2"], ["20", "12"], ["100", "1"], ["100", "100"], ["1000", "1"], ["957", "400"], ["500", "250"], ["9", "1"], ["99", "50"], ["1000", "500"], ["1000000", "1"], ["1000000", "1000000"], ["15", "8"], ["25", "20"], ["200", "150"], ["1000000000", "500000000"], ["50", "25"]], "expected": [10, 1, 13, 1, 9, 2, 9, 17, 188, 1898, 999999999, 1, 9, 10, 2, 1, 99, 1, 459, 323, 1, 54, 548, 1, 999999, 2, 4, 53, 549999998, 31], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "785", "slug": "k-th-smallest-prime-fraction", "id": 785, "title": "K-th Smallest Prime Fraction", "difficulty": "Medium", "category": "array", "link": "https://leetcode.com/problems/k-th-smallest-prime-fraction/", "examples": [{"input": "arr = [1,2,3,5], k = 3", "output": "[2,5]", "explanation": "Ordered quotients start 1/5, 1/3, 2/5, so the third is [2,5]."}, {"input": "arr = [1,7], k = 1", "output": "[1,7]", "explanation": "A single quotient exists."}, {"input": "arr = [1,2,3,5,7], k = 4", "output": "[1,5]", "explanation": "The fourth quotient in order is 1/5."}], "hints": ["Compare two quotients a/b and c/d by cross products a*d versus c*b to avoid floating point.", "With modest sizes, enumerating all pairs and sorting is simple and fast enough.", "For large inputs, binary-search the value and count how many quotients fall below the midpoint."], "statement": "You are given a strictly increasing list `arr` whose first entry is `1`\nand whose remaining entries are primes. Consider every quotient formed by\npicking two positions `i < j` and computing `arr[i] / arr[j]`. Sorting all\nthose quotients from small to large, pick the `k`-th one (counting from 1)\nand report it as the pair `[arr[i], arr[j]]`.\n\nReturn the numerator and denominator as a two-element integer array. No\nfloating-point comparison is needed; cross-multiplication decides the order\nexactly.\n\n**Constraints:**\n- `2 <= arr.length <= 1000`\n- `1 <= arr[i] <= 3 * 10^4`\n- `arr[0] == 1`\n- `arr[i]` is prime for `i > 0`.\n- Values are unique and strictly increasing.\n- `1 <= k <= arr.length * (arr.length - 1) / 2`\n", "solution": "## Approach\n\nList every numerator/denominator pair with `i < j` and order the pairs by\nthe cross product `a*d` versus `c*b`, which matches the order of the true\nquotients without any rounding error. The element at position `k-1` in that\norder is the requested fraction. This direct enumeration is easily fast\nenough for the given limits; a binary search on the value would be the\nfollow-up optimization.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(m^2 log m), where m is the array length and the pair count is O(m^2).\n- **Space Complexity:** O(m^2) to hold all pairs.\n\n## Implementation\n\n```python\nfrom typing import List\nfrom functools import cmp_to_key\n\n\nclass Solution:\n def kthSmallestPrimeFraction(self, arr: List[int], k: int) -> List[int]:\n pairs = []\n n = len(arr)\n for i in range(n):\n for j in range(i + 1, n):\n pairs.append((arr[i], arr[j]))\n\n def cmp(a, b):\n left = a[0] * b[1]\n right = b[0] * a[1]\n return (left > right) - (left < right)\n\n pairs.sort(key=cmp_to_key(cmp))\n return [pairs[k - 1][0], pairs[k - 1][1]]\n```\n", "starter": {"go": "package main\n\nfunc KthSmallestPrimeFraction(arr []int, k int) []int {\n return []int{}\n}", "python": "from typing import List\nclass Solution:\n def kthSmallestPrimeFraction(self, arr: List[int], k: int) -> List[int]:\n return []\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n vector<int> kthSmallestPrimeFraction(vector<int>& arr, int k) {\n return {};\n }\n};"}, "fn": "kthSmallestPrimeFraction", "params": [{"name": "arr", "type": "int_array"}, {"name": "k", "type": "int"}], "outputType": "int_array", "tests": [["[1,2,3,5]", "3"], ["[1,7]", "1"], ["[1,2,3,5,7]", "4"], ["[1,2]", "1"], ["[1,3,5,7]", "1"], ["[1,3,5,7]", "6"], ["[1,2,3,5]", "1"], ["[1,2,3,5]", "6"], ["[1,5,7,11]", "2"], ["[1,5,7,11]", "5"], ["[1,2,5,11,13]", "7"], ["[1,2,5,11,13]", "10"], ["[1,3,7,11,13]", "3"], ["[1,3,7,11,13]", "8"], ["[1,2,3,7,11]", "5"], ["[1,11,13,17,19]", "6"], ["[1,2,3,5,7,11]", "9"], ["[1,2,3,5,7,11]", "15"], ["[1,2,3,5,7,11]", "1"], ["[1,29,47]", "2"], ["[1,2,3,5,7,11,13]", "12"], ["[1,2,3,5,7,11,13]", "21"], ["[1,7,11,13,17]", "4"], ["[1,7,11,13,17]", "9"], ["[1,3,5,7,11,13,17,19]", "14"], ["[1,3,5,7,11,13,17,19]", "28"], ["[1,2,5,7,11,13,17]", "10"], ["[1,2,7,13,19,29]", "11"]], "expected": [[2, 5], [1, 7], [1, 3], [1, 2], [1, 7], [5, 7], [1, 5], [2, 3], [1, 7], [7, 11], [2, 5], [11, 13], [1, 7], [7, 13], [2, 7], [11, 17], [3, 7], [5, 7], [1, 11], [1, 29], [2, 5], [11, 13], [1, 7], [13, 17], [7, 19], [17, 19], [5, 17], [13, 29]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "778", "slug": "k-th-symbol-in-grammar", "id": 778, "title": "K-th Symbol in Grammar", "difficulty": "Medium", "category": "math", "link": "https://leetcode.com/problems/k-th-symbol-in-grammar/", "examples": [{"input": "n = 1, k = 1", "output": "0", "explanation": "The opening row is a single 0."}, {"input": "n = 2, k = 1", "output": "0", "explanation": "The second row starts with 0."}, {"input": "n = 2, k = 2", "output": "1", "explanation": "The second row ends with 1."}], "hints": ["Each position inherits from its parent at index (k+1)/2 in the previous row; an even k flips the parent value.", "Equivalently the answer equals the parity of the number of ones in the binary form of k-1.", "Recursion or a simple loop over the bits both run in O(n) time."], "statement": "Consider a family of binary rows built step by step. The first row holds a\nsingle `0`. To form each later row, every symbol of the previous row is\nexpanded: each `0` turns into the pair `01` and each `1` turns into the pair\n`10`. So the rows grow as `0`, then `01`, then `0110`, then `01101001`,\nand so on, with row `n` holding `2^(n-1)` entries.\n\nYou are given a row index `n` (counting from 1) and a position `k`\n(counting from 1 inside that row). Report the symbol that appears at that\nspot.\n\n**Constraints:**\n- `1 <= n <= 30`\n- `1 <= k <= 2^(n-1)`\n", "solution": "## Approach\n\nThe symbol at `(n, k)` comes from the symbol at `(n-1, (k+1)/2)`: an odd\nposition copies its parent while an even position negates it. Unrolling this\nparent chain counts how many times the path went to an even child, which is\nexactly the number of set bits in `k-1`. An odd count yields `1`, otherwise `0`.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(1) with a popcount, or O(n) by walking parents one row at a time.\n- **Space Complexity:** O(1).\n\n## Implementation\n\n```python\nclass Solution:\n def kthGrammar(self, n: int, k: int) -> int:\n return bin(k - 1).count(\"1\") % 2\n```\n", "starter": {"go": "package main\n\nfunc KthGrammar(n int, k int) int {\n return 0\n}", "python": "class Solution:\n def kthGrammar(self, n: int, k: int) -> int:\n return 0\n", "cpp": "class Solution {\npublic:\n int kthGrammar(int n, int k) {\n return 0;\n }\n};"}, "fn": "kthGrammar", "params": [{"name": "n", "type": "int"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["1", "1"], ["2", "1"], ["2", "2"], ["3", "1"], ["3", "2"], ["3", "3"], ["3", "4"], ["4", "5"], ["4", "8"], ["5", "8"], ["5", "9"], ["5", "16"], ["6", "17"], ["6", "32"], ["7", "32"], ["7", "33"], ["8", "64"], ["8", "65"], ["10", "512"], ["10", "1"], ["15", "16384"], ["20", "524288"], ["30", "1"], ["30", "536870912"], ["30", "268435456"], ["4", "3"], ["9", "100"], ["12", "2048"]], "expected": [0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "563", "slug": "keyboard-row", "id": 563, "title": "Keyboard Row", "difficulty": "Easy", "category": "string", "link": "https://leetcode.com/problems/keyboard-row/", "examples": [{"input": "words = [\"Hello\",\"Alaska\",\"Dad\",\"Peace\"]", "output": "[\"Alaska\",\"Dad\"]", "explanation": "Alaska uses only the middle row and Dad uses only the middle row; the other two mix rows."}, {"input": "words = [\"omk\"]", "output": "[]", "explanation": "The letters span at least two rows."}, {"input": "words = [\"adsdf\",\"sfd\"]", "output": "[\"adsdf\",\"sfd\"]", "explanation": "Both words stay within the middle row."}], "hints": ["Map every letter (lowercased) to its row index 0, 1 or 2 once.", "A word passes when all its letters share the row of its first letter.", "Adaptation: the returned string list maps to string_list; preserve input order."], "statement": "American keyboards group letters into three rows: the top row holds `qwertyuiop`, the middle row holds `asdfghjkl`, and the bottom row holds `zxcvbnm`. Letter case does not matter for this task.\n\nGiven a list of words, keep only those whose letters all come from a single row. Return the kept words in their original order.\n\n**Constraints:**\n- `1 <= words.length <= 20`\n- `1 <= words[i].length <= 100`\n- Words contain only English letters\n", "solution": "## Approach\n\nPrecompute the three row sets in lowercase. For each word, lowercase it and pick the reference set from its first letter, then verify every letter belongs to that set. Matching words are collected in input order, preserving original casing.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(total letters) across all words.\n- **Space Complexity:** O(1) besides the output.\n\n## Implementation\n\n```python\nfrom typing import List\n\nclass Solution:\n def findWords(self, words: List[str]) -> List[str]:\n r1 = set(\"qwertyuiop\")\n r2 = set(\"asdfghjkl\")\n r3 = set(\"zxcvbnm\")\n ans: List[str] = []\n for w in words:\n low = w.lower()\n if not low:\n continue\n f = low[0]\n ref = r1 if f in r1 else (r2 if f in r2 else r3)\n if all(c in ref for c in low):\n ans.append(w)\n return ans\n```\n", "starter": {"go": "package main\n\nfunc FindWords(words []string) []string {\n \n}", "python": "from typing import List\nclass Solution:\n def findWords(self, words: List[str]) -> List[str]:\n pass\n", "cpp": "#include <vector>\n#include <string>\nusing namespace std;\nclass Solution {\npublic:\n vector<string> findWords(vector<string>& words) {\n return {};\n }\n};"}, "fn": "findWords", "params": [{"name": "words", "type": "string_array"}], "outputType": "string_list", "tests": [["['Hello', 'Alaska', 'Dad', 'Peace']"], ["['omk']"], ["['adsdf', 'sfd']"], ["['a', 'b', 'c']"], ["['qwerty', 'asdf', 'zxcv']"], ["['QWERTY', 'ASDF', 'ZXCV']"], ["['Hello']"], ["['Alaska']"], ["['Dad']"], ["['Peace']"], ["['a']"], ["['Z']"], ["['qaz', 'wsx', 'edc']"], ["['typewriter', 'laptop']"], ["['pop', 'mom', 'dad']"], ["['Abc', 'DEF', 'ghi']"], ["['q', 'a', 'z']"], ["['qqqq', 'aaaa', 'zzzz']"], ["['qw', 'as', 'zx']"], ["['HelloWorld']"], ["['aa', 'AA', 'aA']"], ["['row', 'try', 'pop']"], ["['Keyboard', 'Row']"], ["['a', 'qwertyuiop', 'asdfghjkl', 'zxcvbnm']"], ["['Alaska', 'Dad', 'Hello', 'Peace', 'omk']"], ["['sfd', 'adsdf']"], ["['xyz', 'mnb', 'jkl']"], ["['P', 'pP', 'PPp']"]], "expected": null, "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "839", "slug": "keys-and-rooms", "id": 839, "title": "Keys and Rooms", "difficulty": "Medium", "category": "graph", "link": "https://leetcode.com/problems/keys-and-rooms/", "examples": [{"input": "rooms = [[1],[2],[3],[]]", "output": "true", "explanation": "Chain 0->1->2->3 visits all."}, {"input": "rooms = [[1,3],[3,0,1],[2],[0]]", "output": "false", "explanation": "Room 2 stays locked."}, {"input": "rooms = [[]]", "output": "true", "explanation": "Only room exists and starts open."}], "hints": ["Treat rooms as a directed graph with edges from room i to each key inside it.", "Run depth-first or breadth-first search from node 0 and mark visited rooms.", "Answer true exactly when the visited count equals the room count."], "statement": "Decide whether every room can be entered starting from room zero.\n\nThere are `n` rooms numbered `0` to `n-1`. The array `rooms[i]` lists the keys found inside room `i`: each key `k` unlocks room `k`. You begin in room 0 with it already open, collect its keys, and repeatedly open any room for which you hold a key. Return `true` when this process can reach all rooms, otherwise `false`.\n\n**Constraints:**\n- `1 <= rooms.length <= 1000`\n- `0 <= rooms[i].length <= 1000`\n- `0 <= rooms[i][j] < rooms.length`\n", "solution": "## Approach\n\nView each room as a graph node with directed edges to its keys. Start a stack at room zero, pop rooms, and push any unseen neighbours found inside. Marking on push avoids repeats. If every room gets marked, all are reachable.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n + E), where n is the room count and E the total key count.\n- **Space Complexity:** O(n) for the visited flags and the stack.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:\n seen = {0}\n stack = [0]\n while stack:\n u = stack.pop()\n for v in rooms[u]:\n if v not in seen:\n seen.add(v)\n stack.append(v)\n return len(seen) == len(rooms)\n```\n", "starter": {"go": "package main\n\nfunc CanVisitAllRooms(rooms [][]int) bool {\n return false\n}", "python": "from typing import List\nclass Solution:\n def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:\n return False\n", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n bool canVisitAllRooms(vector<vector<int>>& rooms) {\n return false;\n }\n};"}, "fn": "canVisitAllRooms", "params": [{"name": "rooms", "type": "int_array_2d"}], "outputType": "boolean", "tests": [["[[1],[2],[3],[]]"], ["[[1,3],[3,0,1],[2],[0]]"], ["[[]]"], ["[[1],[0]]"], ["[[1,2],[2,3],[3,1],[]]"], ["[[1],[2],[],[0]]"], ["[[1,2,3],[],[],[]]"], ["[[2],[3],[1],[]]"], ["[[1],[2],[0]]"], ["[[0]]"], ["[[1],[],[0]]"], ["[[2,3],[],[],[]]"], ["[[1],[2],[3],[4],[]]"], ["[[1,3],[2],[0],[2]]"], ["[[1],[1],[1],[]]"], ["[[3],[3],[3],[3]]"], ["[[1,2],[3],[3],[4],[]]"], ["[[4],[4],[4],[4],[2]]"], ["[[1,2,3,4],[],[],[],[]]"], ["[[],[1],[2],[3]]"], ["[[1],[2],[3],[0]]"], ["[[2],[0],[1]]"], ["[[1,2],[2],[3],[],[]]"], ["[[5],[5],[5],[5],[5],[0]]"], ["[[1],[3],[2],[4],[5],[]]"], ["[[2,1],[3],[0],[1]]"], ["[[1,2,3],[0],[0],[0]]"], ["[[3,2,1],[],[],[]]"]], "expected": [true, false, true, true, true, false, true, true, true, true, false, false, true, true, false, false, true, false, true, false, true, true, false, false, false, true, true, true], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "627", "slug": "kill-process", "id": 627, "title": "Kill Process", "difficulty": "Medium", "category": "tree", "link": "https://leetcode.com/problems/kill-process/", "examples": [{"input": "pid = [1,3,10,5], ppid = [3,0,5,3], kill = 5", "output": "[5,10]", "explanation": "Ending 5 also ends its child 10."}, {"input": "pid = [1,3,10,5], ppid = [3,0,5,3], kill = 3", "output": "[3,1,5,10]", "explanation": "Ending 3 ends the whole tree underneath it in some order."}, {"input": "pid = [1], ppid = [0], kill = 1", "output": "[1]", "explanation": "A lone entry only ends itself."}], "hints": ["Build a map from each parent value to its direct children, then walk down from kill.", "[BFS/DFS] from the target collects every descendant; the order of the answer does not matter.", "A parent id of 0 marks a root with no owner."], "statement": "Each running program has an id in `pid` and its parent id in `ppid` at the same index; a parent id of `0` means no parent. Ending a program also ends every program below it in the parent-child tree.\n\nGiven `pid`, `ppid` and `kill`, return all ids that stop, starting with `kill` itself. The order of the remaining ids does not matter.\n\n**Constraints:**\n- `1 <= pid.length <= 2000`\n- All `pid` values are distinct and each appears as the kill target in tests.\n- Each `ppid` entry is `0` or another `pid` value.\n", "solution": "## Approach\n\nMap each parent id to its direct children, then walk downward from the target with a queue. Every reached id stops, so collecting them yields the full affected set.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), each id is visited once.\n- **Space Complexity:** O(n) for the child map and the queue.\n\n## Implementation\n\n```python\nfrom typing import List\nfrom collections import defaultdict, deque\nclass Solution:\n def killProcess(self, pid: List[int], ppid: List[int], kill: int) -> List[int]:\n kids = defaultdict(list)\n for p, q in zip(pid, ppid):\n kids[q].append(p)\n ans = []\n dq = deque([kill])\n while dq:\n cur = dq.popleft()\n ans.append(cur)\n dq.extend(kids.get(cur, []))\n return ans\n```\n", "starter": {"go": "package main\n\nfunc KillProcess(pid []int, ppid []int, kill int) []int {\n return []int{}\n}", "python": "from typing import List\nclass Solution:\n def killProcess(self, pid: List[int], ppid: List[int], kill: int) -> List[int]:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n vector<int> killProcess(vector<int>& pid, vector<int>& ppid, int kill) {\n return {};\n }\n};"}, "fn": "killProcess", "params": [{"name": "pid", "type": "int_array"}, {"name": "ppid", "type": "int_array"}, {"name": "kill", "type": "int"}], "outputType": "int_list", "tests": [["[1,3,10,5]", "[3,0,5,3]", "5"], ["[1,3,10,5]", "[3,0,5,3]", "3"], ["[1]", "[0]", "1"], ["[1,2,3]", "[0,1,1]", "1"], ["[1,2,3]", "[0,1,1]", "2"], ["[10,20,30,40,50]", "[0,10,10,20,20]", "10"], ["[10,20,30,40,50]", "[0,10,10,20,20]", "20"], ["[10,20,30,40,50]", "[0,10,10,20,20]", "30"], ["[1,2,3,4,5]", "[0,1,2,3,4]", "1"], ["[1,2,3,4,5]", "[0,1,2,3,4]", "3"], ["[1,2,3,4,5]", "[0,1,2,3,4]", "5"], ["[5,4,3,2,1]", "[4,3,2,1,0]", "1"], ["[5,4,3,2,1]", "[4,3,2,1,0]", "5"], ["[1,2,3,4,5,6,7]", "[0,1,1,2,2,3,3]", "2"], ["[1,2,3,4,5,6,7]", "[0,1,1,2,2,3,3]", "1"], ["[100,200]", "[0,100]", "200"], ["[7,8,9]", "[0,0,8]", "8"], ["[7,8,9]", "[0,0,8]", "7"], ["[1,2,3,4]", "[0,1,1,1]", "1"], ["[1,2,3,4]", "[0,1,1,1]", "4"], ["[2,1,3]", "[1,0,1]", "1"], ["[11,12,13,14,15,16]", "[0,11,11,12,12,13]", "11"], ["[11,12,13,14,15,16]", "[0,11,11,12,12,13]", "12"], ["[11,12,13,14,15,16]", "[0,11,11,12,12,13]", "13"], ["[1,2]", "[0,0]", "2"], ["[1,2,3,4,5,6]", "[0,1,2,2,3,3]", "2"], ["[1,2,3,4,5,6]", "[0,1,2,2,3,3]", "3"], ["[9,10,11,12]", "[10,0,10,11]", "10"]], "expected": [[5, 10], [3, 1, 5, 10], [1], [1, 2, 3], [2], [10, 20, 30, 40, 50], [20, 40, 50], [30], [1, 2, 3, 4, 5], [3, 4, 5], [5], [1, 2, 3, 4, 5], [5], [2, 4, 5], [1, 2, 3, 4, 5, 6, 7], [200], [8, 9], [7], [1, 2, 3, 4], [4], [1, 2, 3], [11, 12, 13, 14, 15, 16], [12, 14, 15], [13, 16], [2], [2, 3, 4, 5, 6], [3, 5, 6], [10, 9, 11, 12]], "loose": true}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "922", "slug": "knight-dialer", "id": 922, "title": "Knight Dialer", "difficulty": "Medium", "category": "dp", "link": "https://leetcode.com/problems/knight-dialer/", "examples": [{"input": "n = 1", "output": "10", "explanation": "Each single digit is one number."}, {"input": "n = 2", "output": "20", "explanation": "Summing jumps from every start gives twenty pairs."}, {"input": "n = 3", "output": "46"}], "hints": ["Model the pad as a graph: each digit points to its knight neighbors (5 points nowhere).", "Dynamic programming over positions: new ways on a digit equal the sum of ways on its predecessors.", "Apply the 1e9+7 modulus at every addition."], "statement": "A chess knight moves on a phone pad laid out as `1 2 3 / 4 5 6 / 7 8 9 / * 0 #`. From a digit it jumps in the usual L shape; `*` and `#` are never used, and `5` has no outgoing jump.\n\nCount how many distinct digit strings of length `n` the knight can trace, starting from any of the ten digits. Return the count modulo `1_000_000_007`.\n\n**Constraints:**\n- `1 <= n <= 5000`\n", "solution": "## Approach\n\nTrack how many ways end on each digit. Start with one way per digit, then repeatedly shift counts along the knight graph: each digit distributes its total to its jump neighbors. After `n-1` transitions, sum all ten totals under the modulus.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), with a constant ten-digit transition per step.\n- **Space Complexity:** O(1), two arrays of size ten.\n\n## Implementation\n\n```python\nclass Solution:\n def knightDialer(self, n: int) -> int:\n MOD = 10 ** 9 + 7\n moves = [[4,6],[6,8],[7,9],[4,8],[3,9,0],[],[1,7,0],[2,6],[1,3],[2,4]]\n dp = [1] * 10\n for _ in range(1, n):\n ndp = [0] * 10\n for d in range(10):\n for nb in moves[d]:\n ndp[nb] = (ndp[nb] + dp[d]) % MOD\n dp = ndp\n return sum(dp) % MOD\n```\n", "starter": {"go": "package main\n\nfunc KnightDialer(n int) int {\n return 0\n}", "python": "class Solution:\n def knightDialer(self, n: int) -> int:\n pass", "cpp": "\nclass Solution {\npublic:\n int knightDialer(int n) {\n return 0;\n }\n};"}, "fn": "knightDialer", "params": [{"name": "n", "type": "int"}], "outputType": "int", "tests": [["1"], ["2"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"], ["9"], ["10"], ["11"], ["12"], ["13"], ["14"], ["15"], ["16"], ["17"], ["18"], ["19"], ["20"], ["25"], ["50"], ["100"], ["200"], ["500"], ["1000"], ["2000"], ["5000"]], "expected": [10, 20, 46, 104, 240, 544, 1256, 2848, 6576, 14912, 34432, 78080, 180288, 408832, 944000, 2140672, 4942848, 11208704, 25881088, 58689536, 715338219, 267287516, 540641702, 38950354, 84202957, 88106097, 71794716, 406880451], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "703", "slug": "knight-probability-in-chessboard", "id": 703, "title": "Knight Probability in Chessboard", "difficulty": "Medium", "category": "dp", "link": "https://leetcode.com/problems/knight-probability-in-chessboard/", "examples": [{"input": "n = 3, k = 2, row = 0, column = 0", "output": "\"0.0625\"", "explanation": "Two first jumps survive and the total survival chance is 1/16."}, {"input": "n = 1, k = 0, row = 0, column = 0", "output": "\"1.0\"", "explanation": "No jumps means certain survival."}, {"input": "n = 1, k = 1, row = 0, column = 0", "output": "\"0.0\"", "explanation": "All jumps leave a 1x1 board."}], "hints": ["This is a portable adaptation: return the probability as a finite decimal string; the checker allows 1e-9 absolute plus 1e-5 relative error.", "Keep a table of survival likelihoods per square and roll it forward one jump at a time, spreading each square's mass over its valid knight neighbours divided by 8.", "Only two layers are needed; the answer is the sum of the final layer."], "statement": "On an `n x n` board a knight begins on square `(row, column)` with zero-based coordinates. At every turn the knight picks uniformly among its eight L-shaped jumps (two squares one way and one square sideways), even when a jump would leave the board. The walk ends after exactly `k` jumps, or sooner if the knight steps outside.\n\nEstimate the chance that the knight is still on the board once the walk stops. Report the probability as a decimal string (for example `\"0.0625\"`).\n\nThis is a portable adaptation: Cojudge has no floating type, so inputs stay integers and the output is a decimal string compared with a small tolerance.\n\n**Constraints:**\n- `1 <= n <= 25`\n- `0 <= k <= 100`\n- `0 <= row, column < n`\n- Answers are compared with absolute tolerance `1e-9` plus relative tolerance `1e-5`.\n", "solution": "## Approach\n\nTrack how likely the knight is to stand on each square after each jump. Start with certainty on the given square, then repeatedly spread every square's mass evenly over its on-board knight destinations (each gets one eighth). Squares with no mass are skipped, and only two board-sized layers are kept. After `k` rounds the sum of the layer is the survival chance, formatted as a decimal string.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(k * n^2), one pass over the board per jump.\n- **Space Complexity:** O(n^2) for two layers.\n\n## Implementation\n\n```python\nclass Solution:\n def knightProbability(self, n: int, k: int, row: int, column: int) -> str:\n moves = [(2,1),(1,2),(-1,2),(-2,1),(-2,-1),(-1,-2),(1,-2),(2,-1)]\n cur = [[0.0]*n for _ in range(n)]\n cur[row][column] = 1.0\n for _ in range(k):\n nxt = [[0.0]*n for _ in range(n)]\n for r in range(n):\n for c in range(n):\n if cur[r][c] == 0:\n continue\n for dr, dc in moves:\n nr, nc = r+dr, c+dc\n if 0 <= nr < n and 0 <= nc < n:\n nxt[nr][nc] += cur[r][c] / 8.0\n cur = nxt\n return str(sum(sum(r) for r in cur))\n```\n", "starter": {"go": "package main\n\nfunc KnightProbability(n int, k int, row int, column int) string {\n return \"\"\n}", "python": "class Solution:\n def knightProbability(self, n: int, k: int, row: int, column: int) -> str:\n return \"\"\n", "cpp": "#include <string>\nusing namespace std;\nclass Solution {\npublic:\n string knightProbability(int n, int k, int row, int column) {\n return \"\";\n }\n};"}, "fn": "knightProbability", "params": [{"name": "n", "type": "int"}, {"name": "k", "type": "int"}, {"name": "row", "type": "int"}, {"name": "column", "type": "int"}], "outputType": "string", "tests": [["3", "2", "0", "0"], ["1", "0", "0", "0"], ["1", "1", "0", "0"], ["3", "1", "0", "0"], ["8", "1", "0", "0"], ["8", "2", "3", "3"], ["8", "30", "6", "4"], ["3", "3", "0", "0"], ["4", "2", "2", "2"], ["5", "5", "2", "2"], ["2", "1", "0", "0"], ["2", "0", "1", "1"], ["25", "0", "12", "12"], ["25", "100", "0", "0"], ["4", "4", "0", "0"], ["6", "3", "2", "2"], ["3", "10", "1", "1"], ["8", "0", "4", "4"], ["5", "1", "0", "0"], ["5", "2", "4", "4"], ["10", "5", "5", "5"], ["3", "5", "2", "2"], ["4", "1", "1", "1"], ["8", "3", "0", "0"], ["6", "6", "0", "5"], ["7", "2", "3", "3"], ["3", "0", "2", "1"], ["8", "10", "7", "7"]], "expected": ["0.0625", "1.0", "0.0", "0.25", "0.25", "0.875", "1.9052566298333653E-4", "0.015625", "0.15625", "0.06640625", "0.0", "1.0", "1.0", "0.0012193746331114305", "0.017578125", "0.359375", "0.0", "1.0", "0.25", "0.1875", "0.588134765625", "9.765625E-4", "0.5", "0.125", "0.02713775634765625", "0.75", "1.0", "0.017395850270986557"], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "89", "slug": "koko-eating-bananas", "id": 89, "title": "Koko Eating Bananas", "difficulty": "Medium", "category": "binary-search", "link": "https://leetcode.com/problems/koko-eating-bananas/", "examples": [{"input": "piles = [3,6,7,11], h = 8", "output": "4", "explanation": "At 4 bananas/hour Koko takes ceil(3/4)+ceil(6/4)+ceil(7/4)+ceil(11/4) = 1+2+2+3 = 8 hours; at 3 bananas/hour she would take 1+2+3+4 = 10 hours, exceeding the 8-hour limit."}, {"input": "piles = [30,11,23,4,20], h = 5", "output": "30", "explanation": "At 30 bananas/hour Koko takes ceil(30/30)+ceil(11/30)+ceil(23/30)+ceil(4/30)+ceil(20/30) = 1+1+1+1+1 = 5 hours; at 29 bananas/hour she would take 2+1+1+1+1 = 6 hours, exceeding the 5-hour limit."}, {"input": "piles = [30,11,23,4,20], h = 6", "output": "23", "explanation": "At 23 bananas/hour Koko takes ceil(30/23)+ceil(11/23)+ceil(23/23)+ceil(4/23)+ceil(20/23) = 2+1+1+1+1 = 6 hours; at 22 bananas/hour she would take 2+1+2+1+1 = 7 hours, exceeding the 6-hour limit."}], "hints": ["For a fixed speed k, one pile of size p takes ceil(p / k) hours.", "If a speed is fast enough, every larger speed is also fast enough.", "Binary-search speeds from 1 through the largest pile and accumulate hours in a wide integer type."], "statement": "Koko has several piles of bananas. `piles[i]` is the number of bananas in pile `i`, and Koko has `h` hours before the guards return.\n\nKoko chooses one positive integer eating speed `k` in bananas per hour. During each hour, she chooses one pile and eats up to `k` bananas from it. If that pile has fewer than `k` bananas, she finishes the pile and does not eat from another pile during the same hour.\n\nReturn the minimum integer speed that lets Koko finish all piles within `h` hours.\n\n**Constraints:**\n\n- `1 <= piles.length <= 10^4`\n- `1 <= piles[i] <= 10^9`\n- `piles.length <= h <= 10^9`\n\n**Portable interface:** Implement `minEatingSpeed(piles, h)` directly. The judge supplies positive pile sizes and returns the minimum speed as an integer.\n", "solution": "## Approach\n\nFor a candidate speed, compute the required hours by summing `ceil(pile / speed)` over all piles. Feasibility is monotonic: once a speed is fast enough, every larger speed is also fast enough. Binary-search the first feasible speed between `1` and the largest pile.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n log M), where `n` is the number of piles and `M` is the largest pile.\n- **Space Complexity:** O(1).\n\n## Implementation\n\n```python\nfrom typing import List\n\n\nclass Solution:\n def minEatingSpeed(self, piles: List[int], h: int) -> int:\n left, right = 1, max(piles)\n while left < right:\n speed = left + (right - left) // 2\n hours = 0\n for pile in piles:\n hours += (pile + speed - 1) // speed\n if hours > h:\n break\n if hours <= h:\n right = speed\n else:\n left = speed + 1\n return left\n```\n", "starter": {"go": "package main\n\nfunc MinEatingSpeed(piles []int, h int) int {\n return 0\n}", "python": "from typing import List\n\nclass Solution:\n def minEatingSpeed(self, piles: List[int], h: int) -> int:\n return 0\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n int minEatingSpeed(vector<int>& piles, int h) {\n return 0;\n }\n};"}, "fn": "minEatingSpeed", "params": [{"name": "piles", "type": "int_array"}, {"name": "h", "type": "int"}], "outputType": "int", "tests": [["[3,6,7,11]", "8"], ["[30,11,23,4,20]", "5"], ["[30,11,23,4,20]", "6"], ["[1]", "1"], ["[1]", "100"], ["[10]", "1"], ["[10]", "10"], ["[3,3,3]", "3"], ["[3,3,3]", "9"], ["[1,2,3,4]", "4"], ["[1,2,3,4]", "10"], ["[1,2,3,4]", "5"], ["[100,100,100,100]", "4"], ["[100,100,100,100]", "400"], ["[100,100,100,100]", "8"], ["[5,9,13,17]", "10"], ["[5,9,13,17]", "4"], ["[5,9,13,17]", "20"], ["[2,2,2,2,2]", "5"], ["[2,2,2,2,2]", "10"], ["[1,1,1,1000000000]", "4"], ["[1,1,1,1000000000]", "1000000000"], ["[1000000000]", "1"], ["[1000000000]", "1000000000"], ["[1000000000,1000000000]", "2"], ["[1000000000,1000000000]", "3"], ["[1000000000,999999999,999999998]", "6"], ["[8,8,8,8,8,8]", "12"], ["[8,8,8,8,8,8]", "18"], ["[4,7,10,13,16]", "15"], ["[4,7,10,13,16]", "8"], ["[4,7,10,13,16]", "5"], ["[9,1,1,1,1]", "9"], ["[9,1,1,1,1]", "5"], ["[6,5,4,3,2,1]", "7"], ["[6,5,4,3,2,1]", "21"], ["[6,5,4,3,2,1]", "6"], ["[17,23,41,59,73]", "20"], ["[17,23,41,59,73]", "9"], ["[17,23,41,59,73]", "5"], ["[2,5,8,11,14,17]", "12"], ["[2,5,8,11,14,17]", "30"], ["[999999937,999999929]", "10"], ["[7,7,7]", "4"], ["[7,7,7]", "20"], ["[1,100,1,100,1,100]", "9"], ["[1,100,1,100,1,100]", "6"], ["[25,36,49,64,81]", "25"], ["[25,36,49,64,81]", "10"], ["[12,34,56,78,90,123,456]", "31"], ["@javascript:JSON.stringify(Array(10000).fill(1000000000))", "10000"]], "expected": [4, 30, 23, 1, 1, 10, 1, 3, 1, 4, 1, 3, 100, 1, 50, 5, 17, 3, 2, 1, 1000000000, 2, 1000000000, 1, 1000000000, 1000000000, 500000000, 4, 3, 4, 8, 16, 2, 9, 5, 1, 6, 12, 30, 73, 6, 2, 199999988, 7, 2, 50, 100, 12, 32, 31, 1000000000], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "101", "slug": "kth-largest-element-in-a-stream", "id": 101, "title": "Kth Largest Element in a Stream", "difficulty": "Easy", "category": "heap", "link": "https://leetcode.com/problems/kth-largest-element-in-a-stream/", "examples": [{"input": "k = 3, nums = [4,5,8,2], additions = [3,5,10,9,4]", "output": "[4,5,5,8,8]", "explanation": "The function returns the third largest value after each insertion."}, {"input": "k = 1, nums = [], additions = [-3,-2,-4,0,4]", "output": "[-3,-2,-2,0,4]", "explanation": "With k = 1, each answer is the maximum value seen so far."}], "hints": ["Keep only the k largest values seen so far.", "A min-heap of size k exposes the current kth largest value at its root.", "Insert each value, remove the heap minimum when its size exceeds k, and record the root after every addition."], "statement": "Design an algorithm that reports the `k`th largest value in an integer stream after each new value arrives.\n\nImplement `kthLargestStream(k, nums, additions)`. Initialize the stream with every value in `nums`. Then process `additions` from left to right. After inserting each value, append the current `k`th largest stream value to the result.\n\nThis is a portable function adaptation of the original constructor-and-`add` API. `nums` may initially contain fewer than `k` values, but after every insertion from `additions` the stream contains at least `k` values.\n\n**Constraints:**\n\n- `1 <= k <= nums.length + 1`\n- `0 <= nums.length <= 10^4`\n- `1 <= additions.length <= 10^4`\n- `-10^4 <= nums[i], additions[i] <= 10^4`\n- After each addition, the total number of stream values is at least `k`.\n", "solution": "## Approach\n\nMaintain a min-heap containing the `k` largest stream values seen so far. After trimming the initial values to `k`, insert each addition, remove the minimum if the heap grows past `k`, and record the heap root as the current kth largest value.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(N log N + A log k) in the worst case, where `N` is `nums.length` and `A` is `additions.length`.\n- **Space Complexity:** O(N + A) including the returned array; the heap uses O(N) space at its initialization peak.\n\n## Implementation\n\n```python\nimport heapq\nfrom typing import List\n\n\nclass Solution:\n def kthLargestStream(self, k: int, nums: List[int], additions: List[int]) -> List[int]:\n heap = nums[:]\n heapq.heapify(heap)\n while len(heap) > k:\n heapq.heappop(heap)\n\n result = []\n for value in additions:\n heapq.heappush(heap, value)\n if len(heap) > k:\n heapq.heappop(heap)\n result.append(heap[0])\n return result\n```\n", "starter": {"go": "package main\n\nfunc KthLargestStream(k int, nums []int, additions []int) []int {\n panic(\"TODO\")\n}", "python": "from typing import List\n\nclass Solution:\n def kthLargestStream(self, k: int, nums: List[int], additions: List[int]) -> List[int]:\n raise NotImplementedError\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n vector<int> kthLargestStream(int k, vector<int>& nums, vector<int>& additions) {\n return {};\n }\n};"}, "fn": "kthLargestStream", "params": [{"name": "k", "type": "int"}, {"name": "nums", "type": "int_array"}, {"name": "additions", "type": "int_array"}], "outputType": "int_array", "tests": [["3", "[4,5,8,2]", "[3,5,10,9,4]"], ["1", "[]", "[-3,-2,-4,0,4]"], ["2", "[0]", "[-1,1,-2,2]"], ["1", "[5]", "[4,6,3]"], ["3", "[4,5]", "[8,2,10]"], ["5", "[1,2,3,4]", "[5,0,6]"], ["2", "[7,7]", "[7,8,6]"], ["3", "[-5,-2,-8]", "[-1,-9,0]"], ["4", "[10,9,8]", "[7,11,12]"], ["2", "[100,-100]", "[0,50,-50]"], ["1", "[-10,-20]", "[-30,-5,-40]"], ["6", "[5,4,3,2,1]", "[0,6,7]"], ["3", "[1,1,1]", "[1,1,2]"], ["2", "[2]", "[1,3,4]"], ["4", "[9,1,8]", "[2,7,10,0]"], ["3", "[0,0]", "[0,-1,1]"], ["5", "[-1,-2,-3,-4]", "[-5,0,1]"], ["2", "[10000,-10000]", "[9999,10000]"], ["3", "[6,5,4,3,2,1]", "[7,0,8]"], ["4", "[1,5,2,4,3]", "[6,-1,7]"], ["2", "[-3,-3,-4]", "[-2,-5,-1]"], ["7", "[1,2,3,4,5,6]", "[7,8]"], ["3", "[10,20]", "[30,5,25]"], ["1", "[0]", "[0,0,1]"], ["4", "[4,4,4]", "[4,5,3]"], ["2", "[8,6,7,5,3,0,9]", "[1,2,10]"], ["5", "[8,6,7,5]", "[3,0,9]"], ["3", "[-10,10,-20,20]", "[0,30,-30]"], ["2", "[1,2,3]", "[4,5,6,7]"], ["4", "[7,6,5]", "[4,3,8,9]"], ["3", "[100,90,80]", "[70,60,110]"], ["5", "[10,10,9,9]", "[8,11,12]"], ["2", "[-1]", "[-2,-3,0,1]"], ["6", "[0,1,2,3,4]", "[5,6,7]"], ["3", "[42,42]", "[42,41,43]"], ["1", "[10000]", "[-10000,9999,10000]"], ["4", "[-8,-6,-7]", "[-5,-9,-4]"], ["2", "[5,1,5,1]", "[5,1,6]"], ["8", "[1,2,3,4,5,6,7]", "[8,0,9]"], ["3", "[9,8]", "[7,6,10,11]"], ["5", "[20,18,16,14]", "[12,22,24]"], ["2", "[0,-1,-2]", "[-3,-4,1]"], ["4", "[3,1,4]", "[1,5,9,2]"], ["3", "[2,7,1,8,2,8]", "[1,8,2]"], ["6", "[-6,-5,-4,-3,-2]", "[-1,0]"], ["2", "[11,13]", "[12,14,10]"], ["5", "[25,20,15,10]", "[5,30,35]"], ["3", "[-100,100]", "[50,-50,0]"], ["4", "[6,6,5,5,4]", "[7,3,8]"], ["1", "[]", "[0,-1,1,-2,2]"], ["1", "[]", "[-10000]"], ["1", "[]", "[10000]"], ["10001", "@javascript:JSON.stringify(Array.from({length:10000},(_,i)=>i%2===0?-10000:10000))", "@javascript:JSON.stringify(Array.from({length:10000},(_,i)=>i%2===0?10000:-10000))"]], "expected": [[4, 5, 5, 8, 8], [-3, -2, -2, 0, 4], [-1, 0, 0, 1], [5, 6, 6], [4, 4, 5], [1, 1, 2], [7, 7, 7], [-5, -5, -2], [7, 8, 9], [0, 50, 50], [-10, -5, -5], [0, 1, 2], [1, 1, 1], [1, 2, 3], [1, 2, 7, 7], [0, 0, 0], [-5, -4, -3], [9999, 10000], [5, 5, 6], [3, 3, 4], [-3, -3, -2], [1, 2], [10, 10, 20], [0, 0, 1], [4, 4, 4], [8, 8, 9], [3, 3, 5], [0, 10, 10], [3, 4, 5, 6], [4, 4, 5, 6], [80, 80, 90], [8, 9, 9], [-2, -2, -1, 0], [0, 1, 2], [42, 42, 42], [10000, 10000, 10000], [-8, -8, -7], [5, 5, 5], [1, 1, 2], [7, 7, 8, 9], [12, 14, 16], [-1, -1, 0], [1, 1, 3, 3], [7, 8, 8], [-6, -5], [12, 13, 13], [5, 10, 15], [-100, -50, 0], [5, 5, 6], [0, 0, 1, 1, 2], [-10000], [10000], [-10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "104", "slug": "kth-largest-element-in-an-array", "id": 104, "title": "Kth Largest Element in an Array", "difficulty": "Medium", "category": "heap", "link": "https://leetcode.com/problems/kth-largest-element-in-an-array/", "examples": [{"input": "nums = [3,2,1,5,6,4], k = 2", "output": "5", "explanation": "Sorted descending: [6,5,4,3,2,1]. The 2nd largest element is 5."}, {"input": "nums = [3,2,3,1,2,4,5,5,6], k = 4", "output": "4", "explanation": "Sorted descending: [6,5,5,4,3,3,2,2,1]. The 4th largest element (counting duplicates) is 4."}], "hints": ["A full sort works, but it does more ordering than the problem requires.", "Keep a min-heap of the k largest values seen so far; its root is the answer.", "Quickselect can achieve expected linear time by partitioning around a pivot."], "statement": "You receive an integer array `nums` and an integer `k`. Identify the element that would appear in position `k` if the array were arranged from largest to smallest.\n\nRepeated values each occupy their own positions, so this is not a question about distinct values.\n\n**Constraints:**\n\n- `1 <= k <= nums.length <= 10^5`\n- `-10^4 <= nums[i] <= 10^4`\n", "solution": "## Approach\n\nSort a copy of the array in ascending order. The kth largest value is then at index `-k`, and duplicate values naturally occupy separate positions.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n log n), where `n` is `nums.length`.\n- **Space Complexity:** O(n) for the sorted copy.\n\n## Implementation\n\n```python\nfrom typing import List\n\n\nclass Solution:\n def findKthLargest(self, nums: List[int], k: int) -> int:\n return sorted(nums)[-k]\n```\n", "starter": {"go": "package main\n\nfunc FindKthLargest(nums []int, k int) int {\n panic(\"TODO\")\n}", "python": "from typing import List\n\nclass Solution:\n def findKthLargest(self, nums: List[int], k: int) -> int:\n raise NotImplementedError\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n int findKthLargest(vector<int>& nums, int k) {\n return 0;\n }\n};"}, "fn": "findKthLargest", "params": [{"name": "nums", "type": "int_array"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["[3,2,1,5,6,4]", "2"], ["[3,2,3,1,2,4,5,5,6]", "4"], ["[-1,-1]", "2"], ["[1]", "1"], ["[2,1]", "1"], ["[2,1]", "2"], ["[5,5,5]", "2"], ["[-3,-2,-1]", "1"], ["[-3,-2,-1]", "3"], ["[10000,-10000,0]", "2"], ["[7,6,5,4,3,2,1]", "4"], ["[1,2,3,4,5]", "5"], ["[1,2,3,4,5]", "1"], ["[9,9,8,8,7,7]", "3"], ["[0,0,0,1]", "4"], ["[4,2,7,1,9,3]", "3"], ["[-5,10,-2,8,0]", "2"], ["[42,42,41,43]", "2"], ["[6,1,6,1,6,1]", "4"], ["[10,20,30,40,50]", "3"], ["[50,40,30,20,10]", "4"], ["[-10,-20,-30,-40]", "2"], ["[8,6,7,5,3,0,9]", "5"], ["[2,7,1,8,2,8,1,8]", "3"], ["[11,13,12,14,10]", "1"], ["[11,13,12,14,10]", "5"], ["[100,99,98,97,96,95]", "6"], ["[-100,100,-50,50,0]", "3"], ["[3,3,2,2,1,1]", "6"], ["[15,14,13,12,11,10,9,8]", "7"], ["[1,100,2,99,3,98]", "3"], ["[0,-1,1,-2,2,-3,3]", "4"], ["[5,4,5,4,5,4,3]", "5"], ["[21,22,23,24,25,26]", "2"], ["[-7,-7,-8,-8,-9]", "3"], ["[1000,500,250,125,62]", "4"], ["[16,8,4,2,1]", "2"], ["[31,41,59,26,53,58]", "4"], ["[9,8,7,6,5,4,3,2,1,0]", "9"], ["[4,1,4,2,4,3,4]", "4"], ["[-1,0,1]", "2"], ["[200,-200,150,-150,100,-100]", "5"], ["[13,13,13,12,12,11]", "1"], ["[13,13,13,12,12,11]", "4"], ["[9999,10000,-9999,-10000]", "2"], ["[2,4,6,8,10,12,14]", "3"], ["[14,12,10,8,6,4,2]", "7"], ["[5,-5,5,-5,0]", "3"], ["[17,19,17,19,18,18]", "5"], ["[10000,10000,10000,-10000]", "3"], ["@javascript:JSON.stringify([-10000,...Array(24999).fill(10000)])", "25000"]], "expected": [5, 4, -1, 1, 2, 1, 5, -1, -3, 0, 4, 1, 5, 8, 0, 4, 8, 42, 1, 30, 20, -20, 5, 8, 14, 10, 95, 0, 1, 9, 98, 0, 4, 25, -8, 125, 8, 41, 1, 4, 0, -150, 13, 12, 9999, 10, 2, 0, 17, 10000, -10000], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "69", "slug": "kth-smallest-element-in-a-bst", "id": 69, "title": "Kth Smallest Element in a BST", "difficulty": "Medium", "category": "tree", "link": "https://leetcode.com/problems/kth-smallest-element-in-a-bst/", "examples": [{"input": "root = [3,1,4,null,2], k = 1", "output": "1", "explanation": "The BST [3,1,4,null,2] sorted in ascending order is [1,2,3,4]; the 1st smallest value is 1."}, {"input": "root = [5,3,6,2,4,null,7,1], k = 3", "output": "3", "explanation": "The BST [5,3,6,2,4,null,7,1] sorted in ascending order is [1,2,3,4,5,6,7]; the 3rd smallest value is 3."}], "hints": ["Use in-order traversal to visit nodes in ascending order and stop at k."], "statement": "You are given the `root` of a binary search tree together with an integer `k`. Return the value occupying the `k`-th place (counting from 1) when all node values are listed from smallest to largest.\n\n**Constraints:**\n\n- The number of nodes in the tree is n.\n- 1 \u2264 k \u2264 n \u2264 10^4\n- 0 \u2264 Node.val \u2264 10^4\n", "solution": "## Approach\n\nPerform an iterative inorder traversal of the BST using a stack. Since inorder traversal visits nodes in sorted order, the kth visited node is the kth smallest element.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), where n is the number of nodes in the tree.\n- **Space Complexity:** O(h), where h is the height of the tree (stack size).\n\n## Implementation\n\n```python\nfrom typing import Optional\nclass Solution:\n def kthSmallest(self, root: Optional[TreeNode], k: int) -> int:\n stack = []\n cur = root\n while cur or stack:\n while cur:\n stack.append(cur)\n cur = cur.left\n cur = stack.pop()\n k -= 1\n if k == 0:\n return cur.val\n cur = cur.right\n```\n", "starter": {"go": "// Definition for a binary tree node.\n// type TreeNode struct {\n// Val int\n// Left *TreeNode\n// Right *TreeNode\n// }\npackage main\n\nfunc KthSmallest(root *TreeNode, k int) int {\n \n}", "python": "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\n\nclass Solution:\n def kthSmallest(self, root, k: int) -> int:\n # TODO: return kth smallest value in BST\n pass\n", "cpp": "/*\nDefinition for a binary tree node.\nstruct TreeNode {\n int val;\n TreeNode *left;\n TreeNode *right;\n TreeNode(): val(0), left(nullptr), right(nullptr) {}\n TreeNode(int x): val(x), left(nullptr), right(nullptr) {}\n TreeNode(int x, TreeNode* left, TreeNode* right): val(x), left(left), right(right) {}\n};\n*/\nclass Solution {\npublic:\n int kthSmallest(TreeNode* root, int k) {\n \n }\n};\n"}, "fn": "kthSmallest", "params": [{"name": "root", "type": "tree_node", "visualizeType": "tree_node"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["[3,1,4,null,2]", "1"], ["[5,3,6,2,4,null,7,1]", "3"], ["[2,1,3]", "2"], ["[1]", "1"], ["[5,4,6,3]", "1"], ["[6,3,8,2,5,7,9,1,4]", "5"], ["[4,2,6,1,3,5,7]", "4"], ["[4,2,6,1,3,5,7]", "1"], ["[4,2,6,1,3,5,7]", "7"], ["[10,5,15,3,7,null,18]", "3"], ["[7,3,9,1,5,null,11]", "2"], ["[8,3,10,1,6,null,14,null,null,4,7]", "5"], ["[1,null,2]", "2"], ["[2,null,3]", "1"], ["[3,1,null]", "2"], ["[5,3,7,2,4,6,8]", "6"], ["[5,3,7,2,4,6,8]", "2"], ["[9,4,12,2,6,10,14]", "4"], ["[20,10,30,5,15,25,35]", "7"], ["[6,2,8,1,4,null,null,null,null,3,5]", "3"], ["[50,30,70,20,40,60,80]", "5"], ["[4,1,null]", "1"], ["[2,1,null]", "1"], ["[3,2,null,1,null]", "1"], ["[1,null,3,null,5]", "3"], ["[10,5,null,3,null]", "2"], ["[15,10,20,null,null,null,25]", "3"], ["[7,5,9,4,6,8,10]", "1"], ["[7,5,9,4,6,8,10]", "7"], ["[11,6,15,3,8,null,18]", "4"]], "expected": [1, 3, 2, 1, 3, 5, 4, 1, 7, 7, 3, 7, 2, 2, 3, 7, 3, 9, 35, 3, 60, 1, 1, 1, 5, 5, 20, 4, 10, 11], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "454", "slug": "kth-smallest-element-in-a-sorted-matrix", "id": 454, "title": "Kth Smallest Element in a Sorted Matrix", "difficulty": "Medium", "category": "heap", "link": "https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/", "examples": [{"input": "matrix = [[1,5,9],[10,11,13],[12,13,15]], k = 8", "output": "13", "explanation": "8th of the nine ordered values."}, {"input": "matrix = [[-5]], k = 1", "output": "-5", "explanation": "Single cell."}, {"input": "matrix = [[1,2],[3,4]], k = 3", "output": "3", "explanation": "Ordered values [1,2,3,4]."}], "hints": ["Seed a min-heap with the first cell of every row.", "Pop the smallest k-1 times, pushing the right neighbor of each pop.", "The k-th pop is the answer; binary search on the value range is an alternative."], "statement": "Pull the k-th tiniest value out of a fully sorted grid.\n\nYou get an `n x n` matrix whose rows and columns each grow from small to large. Collecting every cell and sorting would order all `n^2` values; return the `k`-th entry of that order (counting from 1), keeping duplicates as separate positions rather than collapsing them.\n\n**Constraints:**\n- `n == matrix.length == matrix[i].length`\n- `1 <= n <= 300`\n- `-10^9 <= matrix[i][j] <= 10^9`\n- Every row and every column is sorted in non-decreasing order.\n- `1 <= k <= n * n`\n", "solution": "## Approach\n\nPush the head of each row into a min-heap keyed by cell value. Remove the minimum `k` times, each time inserting the popped cell's right neighbor so the heap always holds the next unseen entry of every touched row. The last popped value is the k-th smallest.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(k log n), where n is the matrix side length.\n- **Space Complexity:** O(n) for one heap entry per row.\n\n## Implementation\n\n```python\nimport heapq\nfrom typing import List\nclass Solution:\n def kthSmallest(self, matrix: List[List[int]], k: int) -> int:\n n = len(matrix)\n pq = [(matrix[r][0], r, 0) for r in range(n)]\n heapq.heapify(pq)\n val = 0\n for _ in range(k):\n val, r, c = heapq.heappop(pq)\n if c + 1 < len(matrix[r]):\n heapq.heappush(pq, (matrix[r][c + 1], r, c + 1))\n return val\n```\n", "starter": {"go": "package main\n\nfunc KthSmallest(matrix [][]int, k int) int {\n return 0\n}", "python": "from typing import List\n\nclass Solution:\n def kthSmallest(self, matrix: List[List[int]], k: int) -> int:\n return 0\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n int kthSmallest(vector<vector<int>>& matrix, int k) {\n return 0;\n }\n};"}, "fn": "kthSmallest", "params": [{"name": "matrix", "type": "int_array_2d"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["[[1,5,9],[10,11,13],[12,13,15]]", "8"], ["[[-5]]", "1"], ["[[1,2],[3,4]]", "3"], ["[[1,2],[1,3]]", "2"], ["[[1,2],[1,3]]", "4"], ["[[1,3,5],[6,7,12],[11,14,14]]", "6"], ["[[1,4,7,11],[2,5,8,12],[3,6,9,16],[10,13,14,17]]", "5"], ["[[1,4,7,11],[2,5,8,12],[3,6,9,16],[10,13,14,17]]", "16"], ["[[-5,-4],[-4,-3]]", "3"], ["[[1,2,3],[4,5,6],[7,8,9]]", "1"], ["[[1,2,3],[4,5,6],[7,8,9]]", "9"], ["[[1,2,3],[4,5,6],[7,8,9]]", "5"], ["[[1,1,1],[1,1,1],[1,1,1]]", "5"], ["[[5,9,11],[8,10,12],[13,14,15]]", "4"], ["[[0,0,0],[0,1,1],[0,1,2]]", "7"], ["[[-1000000000,0],[0,1000000000]]", "2"], ["[[1,5],[5,6]]", "2"], ["[[1,10,20],[5,15,25],[10,20,30]]", "7"], ["[[2,6,8],[3,7,10],[5,8,11]]", "5"], ["[[1]]", "1"], ["[[3,3,3],[3,3,3],[3,4,5]]", "8"], ["[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]", "10"], ["[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]", "13"], ["[[-1,0,1],[2,3,4],[5,6,7]]", "6"], ["[[10,20],[15,25]]", "4"], ["[[1,3],[2,4]]", "3"], ["[[7,10,12],[9,11,13],[14,16,18]]", "9"], ["[[0,1],[0,1]]", "3"], ["[[-2,-1,0],[1,2,3],[4,5,6]]", "4"], ["[[100,200,300],[150,250,350],[200,300,400]]", "5"]], "expected": [13, -5, 3, 1, 3, 11, 5, 17, -4, 1, 9, 5, 1, 10, 1, 0, 5, 20, 7, 1, 4, 10, 13, 4, 25, 3, 18, 1, 1, 250], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "687", "slug": "kth-smallest-number-in-multiplication-table", "id": 687, "title": "Kth Smallest Number in Multiplication Table", "difficulty": "Hard", "category": "binary-search", "link": "https://leetcode.com/problems/kth-smallest-number-in-multiplication-table/", "examples": [{"input": "m = 3, n = 3, k = 5", "output": "3", "explanation": "The 3 by 3 table holds [1,2,3,2,4,6,3,6,9]; ordered they are [1,2,2,3,3,4,6,6,9], so the 5th value is 3."}, {"input": "m = 2, n = 3, k = 6", "output": "6", "explanation": "The 2 by 3 table holds [1,2,3,2,4,6]; the 6th smallest is 6."}, {"input": "m = 1, n = 1, k = 1", "output": "1"}], "hints": ["Count how many table entries are at most mid by adding min(n, mid / row) over each row.", "The count grows monotonically with mid, so binary-search the smallest mid whose count reaches k.", "Rows and columns are symmetric; iterate over the smaller dimension when counting."], "statement": "Consider an `m` by `n` grid where the cell in row `i` and column `j` (both counting from 1) stores the product `i * j`.\n\nImagine writing all `m * n` products in nondecreasing order. Return the `k`-th entry in that order (`k` counts from 1).\n\n**Constraints:**\n- `1 <= m, n <= 30000`\n- `1 <= k <= m * n`\n", "solution": "## Approach\n\nCount, for a candidate value `mid`, how many table entries are less than or equal to it. Row `i` contributes `min(n, mid / i)` such entries. This count rises monotonically with `mid`, so the desired answer is the smallest `mid` whose count reaches `k`, found with binary search over `[1, m*n]`.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(min(m, mid) log(m*n)) for counting inside binary search; effectively O(m log(m*n)).\n- **Space Complexity:** O(1).\n\n## Implementation\n\n```python\nclass Solution:\n def findKthNumber(self, m: int, n: int, k: int) -> int:\n lo, hi = 1, m * n\n while lo < hi:\n mid = (lo + hi) // 2\n cnt = 0\n for i in range(1, min(m, mid) + 1):\n cnt += min(n, mid // i)\n if cnt >= k:\n hi = mid\n else:\n lo = mid + 1\n return lo\n```\n", "starter": {"go": "package main\n\nfunc FindKthNumber(m int, n int, k int) int {\n return 0\n}", "python": "class Solution:\n def findKthNumber(self, m: int, n: int, k: int) -> int:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int findKthNumber(int m, int n, int k) {\n return 0;\n }\n};"}, "fn": "findKthNumber", "params": [{"name": "m", "type": "int"}, {"name": "n", "type": "int"}, {"name": "k", "type": "int"}], "outputType": "int", "tests": [["3", "3", "5"], ["2", "3", "6"], ["1", "1", "1"], ["1", "10", "5"], ["10", "1", "7"], ["5", "5", "1"], ["5", "5", "25"], ["5", "5", "13"], ["3", "5", "8"], ["4", "4", "8"], ["10", "10", "50"], ["10", "10", "1"], ["10", "10", "100"], ["2", "2", "3"], ["2", "2", "4"], ["3", "3", "1"], ["3", "3", "9"], ["6", "7", "20"], ["9", "9", "81"], ["42", "34", "500"], ["100", "100", "5000"], ["1", "30000", "15000"], ["30000", "1", "20000"], ["300", "300", "45000"], ["7", "7", "30"], ["4", "9", "17"], ["15", "20", "150"], ["25", "25", "313"]], "expected": [3, 6, 1, 5, 7, 1, 25, 8, 5, 4, 24, 1, 100, 2, 4, 1, 9, 10, 81, 170, 1917, 15000, 20000, 16946, 16, 9, 64, 128], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "418", "slug": "largest-bst-subtree", "id": 418, "title": "Largest BST Subtree", "difficulty": "Medium", "category": "tree", "link": "https://leetcode.com/problems/largest-bst-subtree/", "examples": [{"input": "root = [10,5,15,1,8,null,7]", "output": "3", "explanation": "The branch rooted at 5 (nodes 5, 1, 8) is ordered with 3 nodes; the right branch breaks ordering."}, {"input": "root = [2,1,3]", "output": "3", "explanation": "The whole tree respects the ordering, so all 3 nodes count."}, {"input": "root = [1]", "output": "1", "explanation": "A single node always forms an ordered subtree of size 1."}], "hints": ["Return per-subtree info bottom-up: whether it is ordered, its size, and its value range.", "A subtree is ordered when both children are ordered and max(left) < node < min(right).", "Track the best size seen anywhere, since the largest ordered portion may sit deep inside."], "statement": "Given the root of a binary tree, locate the biggest connected portion that itself obeys the binary search ordering, and report how many nodes it holds.\n\nA portion qualifies when, for every node inside it, all values in its left descendant set are strictly smaller and all values in its right descendant set are strictly larger. A single node always qualifies, and an empty tree contributes size zero.\n\nReturn the node count of the largest such portion.\n\n**Constraints:**\n- `0 <= number of nodes <= 10^4`\n- `-10^4 <= Node.val <= 10^4`\n", "solution": "## Approach\n\nWalk the tree bottom-up, with each call reporting whether its subtree is ordered, how large it is, and the smallest and largest values it contains. An empty child counts as ordered with an extreme range so comparisons succeed. A parent is ordered exactly when both children are ordered and its own value falls strictly between the left maximum and the right minimum; in that case its size and range extend the children's, and the global best is updated.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), each node visited once.\n- **Space Complexity:** O(h) recursion depth, O(n) worst case.\n\n## Implementation\n\n```python\nclass Solution:\n def largestBSTSubtree(self, root) -> int:\n self.best = 0\n def dfs(n):\n if not n:\n return (True, 0, float(\"inf\"), float(\"-inf\"))\n lb, lsz, llo, lhi = dfs(n.left)\n rb, rsz, rlo, rhi = dfs(n.right)\n if lb and rb and lhi < n.val < rlo:\n sz = lsz + rsz + 1\n if sz > self.best:\n self.best = sz\n return (True, sz, min(n.val, llo), max(n.val, rhi))\n return (False, 0, 0, 0)\n dfs(root)\n return self.best\n```\n", "starter": {"go": "package main\n\n/*\nDefinition for a binary tree node.\ntype TreeNode struct {\n Val int\n Left *TreeNode\n Right *TreeNode\n}\n*/\n\nfunc LargestBSTSubtree(root *TreeNode) int {\n return 0\n}", "python": "# Definition for a binary tree node.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\n\nclass Solution:\n def largestBSTSubtree(self, root) -> int:\n pass", "cpp": "/*\nDefinition for a binary tree node.\nstruct TreeNode {\n int val;\n TreeNode *left;\n TreeNode *right;\n TreeNode(): val(0), left(nullptr), right(nullptr) {}\n TreeNode(int x): val(x), left(nullptr), right(nullptr) {}\n TreeNode(int x, TreeNode* left, TreeNode* right): val(x), left(left), right(right) {}\n};\n*/\nclass Solution {\npublic:\n int largestBSTSubtree(TreeNode* root) {\n return 0;\n }\n};"}, "fn": "largestBSTSubtree", "params": [{"name": "root", "type": "tree_node", "visualizeType": "tree_node"}], "outputType": "int", "tests": [["[10,5,15,1,8,null,7]"], ["[4,2,7,2,3,5,null,2,null,null,null,null,null,1]"], ["[2,1,3]"], ["[1]"], ["[]"], ["[1,2,3]"], ["[3,2,1]"], ["[5,1,4,null,null,3,6]"], ["[3,1,4,null,2]"], ["[1,null,2,null,3]"], ["[3,2,null,1]"], ["[10,5,15,null,null,6,20]"], ["[0]"], ["[-10,-5,0,5,10]"], ["[5,3,8,1,4,7,9]"], ["[5,3,8,1,4,null,9]"], ["[2,null,3,null,4]"], ["[4,null,5,null,6]"], ["[1,1,1]"], ["[10,5,15,1,8,12,20]"], ["[7,3,10,2,5,null,12]"], ["[100,50,150,25,75,125,175]"], ["[-5,-10,0]"], ["[2,2,2]"], ["[6,3,9,1,4,8,10]"], ["[4,2,6,1,3,5,7]"], ["[1,null,2]"], ["[2,1]"]], "expected": [3, 2, 3, 1, 0, 1, 1, 3, 4, 3, 3, 3, 1, 1, 7, 6, 3, 3, 1, 7, 6, 7, 3, 1, 7, 7, 2, 2], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "939", "slug": "largest-component-size-by-common-factor", "id": 939, "title": "Largest Component Size by Common Factor", "difficulty": "Hard", "category": "array", "link": "https://leetcode.com/problems/largest-component-size-by-common-factor/", "examples": [{"input": "nums = [4,6,15,35]", "output": "4", "explanation": "Factors chain all four together."}, {"input": "nums = [20,50,9,63]", "output": "2", "explanation": "Two pairs form two groups of two."}, {"input": "nums = [2,3,6,7,4,12,21,39]", "output": "8", "explanation": "Everything connects into one group."}], "hints": ["Split each number into its distinct prime factors; numbers sharing a prime belong together.", "Union the indices that meet at the same prime with a disjoint-set structure keyed by prime.", "The value 1 has no prime factor and always stays solitary."], "statement": "Group numbers that share a divisor larger than one and report the biggest group.\n\nPicture each entry of `nums` as a node. Draw an edge between two nodes whenever their values share a common factor above 1 (for example 6 and 35 stay apart, while 6 and 10 connect through 2). Connected nodes form groups; lone numbers with no edges, such as 1 or an isolated prime, form groups of one.\n\nGiven distinct positive integers, return the size of the largest group.\n\n**Constraints:**\n- `1 <= nums.length <= 2 * 10^4`\n- `1 <= nums[i] <= 10^5`\n- All values in `nums` are distinct.\n", "solution": "## Approach\n\nFactor every number into distinct primes and union the positions that share a prime, remembering the first index seen per prime. Positions meeting at any prime end up in one set, and the value 1 (with no factors) stays alone. The largest set size is the answer.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n sqrt(M)) for factoring n numbers up to M, plus near-constant union work.\n- **Space Complexity:** O(n + P) for the union arrays and the prime table.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def largestComponentSize(self, nums: List[int]) -> int:\n n = len(nums)\n parent = list(range(n))\n size = [1] * n\n\n def find(x):\n while parent[x] != x:\n parent[x] = parent[parent[x]]\n x = parent[x]\n return x\n\n def union(a, b):\n ra, rb = find(a), find(b)\n if ra == rb:\n return\n if size[ra] < size[rb]:\n ra, rb = rb, ra\n parent[rb] = ra\n size[ra] += size[rb]\n\n def factors(x):\n out = []\n v = x\n p = 2\n while p * p <= v:\n if v % p == 0:\n out.append(p)\n while v % p == 0:\n v //= p\n p += 1\n if v > 1:\n out.append(v)\n return out\n\n first = {}\n for i, v in enumerate(nums):\n for p in factors(v):\n if p in first:\n union(i, first[p])\n else:\n first[p] = i\n return max(size)\n```\n", "starter": {"go": "package main\n\nfunc LargestComponentSize(nums []int) int {\n return 0\n}", "python": "from typing import List\nclass Solution:\n def largestComponentSize(self, nums: List[int]) -> int:\n pass", "cpp": "#include <vector>\n#include <string>\nusing namespace std;\n\nclass Solution {\npublic:\n int largestComponentSize(vector<int>& nums) {\n return 0;\n }\n};"}, "fn": "largestComponentSize", "params": [{"name": "nums", "type": "int_array"}], "outputType": "int", "tests": [["[4, 6, 15, 35]"], ["[20, 50, 9, 63]"], ["[2, 3, 6, 7, 4, 12, 21, 39]"], ["[1]"], ["[1, 2, 3]"], ["[2]"], ["[6, 10, 15]"], ["[2, 4, 8, 16]"], ["[3, 5, 7, 11]"], ["[6, 12, 18, 24]"], ["[1, 4, 9]"], ["[30, 42, 70, 105]"], ["[2, 3, 5, 7, 11, 13]"], ["[4, 9, 25, 49]"], ["[6, 35, 10, 21]"], ["[100, 101]"], ["[12, 15, 18]"], ["[7, 14, 21, 28]"], ["[5, 10, 15, 20]"], ["[8, 9]"], ["[6, 7, 13]"], ["[14, 21, 35]"], ["[2, 6, 12]"], ["[9, 27, 81]"], ["[1, 2]"], ["[3, 6, 10, 15]"], ["[11, 22, 33]"], ["[16, 20, 25]"]], "expected": [4, 2, 8, 1, 1, 1, 3, 4, 1, 4, 1, 4, 1, 1, 4, 1, 3, 4, 4, 1, 1, 3, 3, 3, 1, 4, 3, 3], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "447", "slug": "largest-divisible-subset", "id": 447, "title": "Largest Divisible Subset", "difficulty": "Medium", "category": "dp", "link": "https://leetcode.com/problems/largest-divisible-subset/", "examples": [{"input": "nums = [1,2,3]", "output": "[1,2]", "explanation": "1 divides 2, giving a group of size 2; [1,3] is equally valid."}, {"input": "nums = [1,2,4,8]", "output": "[1,2,4,8]", "explanation": "Each value divides the next, so the whole input is one valid group."}, {"input": "nums = [3,5,10,20]", "output": "[5,10,20]", "explanation": "5 divides 10 and 20, and 10 divides 20."}], "hints": ["Sort the numbers first; divisibility only needs checking on the sorted order.", "Use dynamic programming where each entry extends the best chain ending at an earlier divisor.", "Remember the predecessor of each choice so the longest chain can be rebuilt."], "statement": "Pick the biggest group of numbers where every two members divide evenly one way or the other.\n\nYou are given an array `nums` of distinct positive integers. Choose a subset `answer` as large as possible such that for every pair of values `x`, `y` inside it, one of them divides the other (that is, `x % y == 0` or `y % x == 0`). The order of the returned group does not matter; when several biggest groups exist, any one of them is accepted.\n\n*Portable adaptation:* the classic statement returns a list of boxed integers; here return a plain integer array holding the same values.\n\n**Constraints:**\n- `1 <= nums.length <= 1000`\n- `1 <= nums[i] <= 2 * 10^9`\n- Every value in `nums` is distinct.\n", "solution": "## Approach\n\nSort the values so every divisor appears before its multiples. Run a longest-chain dynamic program where each position extends the best earlier divisor, tracking predecessors to rebuild one optimal group. Sorting makes consecutive divisibility imply pairwise divisibility by transitivity.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n^2), where n is the length of `nums`, dominated by the pairwise divisibility checks after an O(n log n) sort.\n- **Space Complexity:** O(n) for the DP lengths, predecessors, and the rebuilt chain.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def largestDivisibleSubset(self, nums: List[int]) -> List[int]:\n s = sorted(nums)\n n = len(s)\n dp = [1] * n\n prev = [-1] * n\n best = 0\n for i in range(n):\n for j in range(i):\n if s[i] % s[j] == 0 and dp[j] + 1 > dp[i]:\n dp[i] = dp[j] + 1\n prev[i] = j\n if dp[i] > dp[best]:\n best = i\n chain = []\n i = best\n while i != -1:\n chain.append(s[i])\n i = prev[i]\n return chain\n```\n", "starter": {"go": "package main\n\nfunc LargestDivisibleSubset(nums []int) []int {\n return []int{}\n}", "python": "from typing import List\n\nclass Solution:\n def largestDivisibleSubset(self, nums: List[int]) -> List[int]:\n return []\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n vector<int> largestDivisibleSubset(vector<int>& nums) {\n return {};\n }\n};"}, "fn": "largestDivisibleSubset", "params": [{"name": "nums", "type": "int_array"}], "outputType": "int_array", "tests": [["[1,2,3]"], ["[1,2,4,8]"], ["[3,5,10,20]"], ["[1]"], ["[2]"], ["[2,3,5,7,11]"], ["[1,2,4,8,16]"], ["[4,8,10,240]"], ["[3,6,9,27]"], ["[5,9,18,54,108]"], ["[1,2,3,4,6,8,12,24]"], ["[7,14,28,56,3,6,12]"], ["[2,4,16,256]"], ["[1000000000,2000000000]"], ["[1,3,9,27,81]"], ["[6,12,24,36,72]"], ["[2,3,4,9,8,16,32]"], ["[5,10,15,20,25,50,100]"], ["[13]"], ["[1,2]"], ["[2,5]"], ["[9,18,27,36,72,144]"], ["[1,5,25,125,625]"], ["[12,18,24,36,48]"], ["[100,200,300,600]"], ["[17,34,51,102,204]"], ["[8,16,32,5,10,20,40]"], ["[1000000,1000,10,1]"], ["[2147483647]"], ["[1,2147483647]"], ["[2,4,8,3,9,27]"], ["[6,10,15,30,60]"]], "expected": [[2, 1], [8, 4, 2, 1], [20, 10, 5], [1], [2], [2], [16, 8, 4, 2, 1], [240, 8, 4], [27, 9, 3], [108, 54, 18, 9], [24, 8, 4, 2, 1], [56, 28, 14, 7], [256, 16, 4, 2], [2000000000, 1000000000], [81, 27, 9, 3, 1], [72, 24, 12, 6], [32, 16, 8, 4, 2], [100, 20, 10, 5], [13], [2, 1], [2], [144, 72, 36, 18, 9], [625, 125, 25, 5, 1], [48, 24, 12], [600, 200, 100], [204, 102, 34, 17], [40, 20, 10, 5], [1000000, 1000, 10, 1], [2147483647], [2147483647, 1], [8, 4, 2], [60, 30, 6]], "loose": true}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "750", "slug": "largest-number-at-least-twice-of-others", "id": 750, "title": "Largest Number At Least Twice of Others", "difficulty": "Easy", "category": "array", "link": "https://leetcode.com/problems/largest-number-at-least-twice-of-others/", "examples": [{"input": "nums = [3,6,1,0]", "output": "1", "explanation": "6 at index 1 is at least twice every other value."}, {"input": "nums = [1,2,3,4]", "output": "-1", "explanation": "4 is less than twice 3."}, {"input": "nums = [10,5,3]", "output": "0", "explanation": "10 at index 0 doubles 5 and more."}], "hints": ["Make one pass to find the maximum value and remember its position.", "Make a second pass comparing the maximum against twice each other entry; any failure means -1.", "Comparing with 2*x avoids fractions entirely."], "statement": "You are given an integer array `nums` in which the largest value occurs exactly once.\n\nLocate the biggest entry. If it is at least twice as large as every other entry, return its index. Otherwise return `-1`.\n\n**Constraints:**\n- `2 <= nums.length <= 50`\n- `0 <= nums[i] <= 100`\n- The largest entry of `nums` is unique.\n", "solution": "## Approach\n\nFind the maximum value and its index in a first scan. Then scan again and verify the maximum reaches at least twice each other entry. Return the stored index when all checks pass, otherwise return -1.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), where n is the array length. Two linear passes suffice.\n- **Space Complexity:** O(1) besides the input.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def dominantIndex(self, nums: List[int]) -> int:\n mx = max(nums)\n idx = nums.index(mx)\n for i, x in enumerate(nums):\n if i != idx and mx < 2 * x:\n return -1\n return idx\n```\n", "starter": {"go": "package main\n\nfunc DominantIndex(nums []int) int {\n return 0\n}", "python": "from typing import List\nclass Solution:\n def dominantIndex(self, nums: List[int]) -> int:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int dominantIndex(vector<int>& nums) {\n return 0;\n }\n};"}, "fn": "dominantIndex", "params": [{"name": "nums", "type": "int_array"}], "outputType": "int", "tests": [["[3,6,1,0]"], ["[1,2,3,4]"], ["[10,5,3]"], ["[0,0,0,1]"], ["[1,0]"], ["[0,1]"], ["[1,2]"], ["[2,1]"], ["[3,1]"], ["[2,3]"], ["[0,0,3,2]"], ["[10,5,3]"], ["[10,6,3]"], ["[0,1,0]"], ["[100,0,0]"], ["[50,25,12]"], ["[50,26,12]"], ["[1,2,3,5]"], ["[1,2,3,6]"], ["[0,0,0,0,5]"], ["[5,0,0,0,0]"], ["[3,6,1,0,10]"], ["[1,10,2,3]"], ["[99,50,49]"], ["[100,50,49]"], ["[1,1,2]"], ["[2,2,5]"], ["[8,1,2,3]"]], "expected": [1, -1, 0, 3, 0, 1, 1, 0, 0, -1, -1, 0, -1, 1, 0, 0, -1, -1, 3, 4, 0, -1, 1, -1, 0, 2, 2, 0], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "325", "slug": "largest-number", "id": 325, "title": "Largest Number", "difficulty": "Medium", "category": "array", "link": "https://leetcode.com/problems/largest-number/", "examples": [{"explanation": "Gluing as \"210\" beats \"102\".", "input": "nums = [10,2]", "output": "\"210\""}, {"explanation": "The order [9,5,34,3,30] gives the largest glued value.", "input": "nums = [3,30,34,5,9]", "output": "\"9534330\""}, {"explanation": "All zeros collapse to a single \"0\".", "input": "nums = [0,0]", "output": "\"0\""}], "hints": ["Turn each number into text and sort with a custom rule comparing a+b against b+a.", "If the largest piece after sorting is \"0\", the whole answer is \"0\"."], "statement": "Given non-negative integers, arrange their order so that gluing them together forms the largest possible number. Return that number as a string.\n\nComparison is by glued pairs: for two numbers `a` and `b`, place `a` before `b` when `a + b` is larger than `b + a`. When every number is zero, return `\"0\"` rather than a run of zeros.\n\n**Constraints:**\n- `1 <= nums.length <= 100`\n- `0 <= nums[i] <= 10^9`\n", "solution": "## Approach\n\nConvert each number to text and order the pieces so that the glued pair looks biggest: put `a` before `b` when `a + b` exceeds `b + a`. Gluing the sorted pieces gives the largest arrangement. If the first piece is zero, every piece is zero, so return a single zero.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n log n * k), where n is the count and k is the average digit length for comparisons.\n- **Space Complexity:** O(n * k) for the text pieces.\n\n## Implementation\n\n```python\nfrom typing import List\nfrom functools import cmp_to_key\nclass Solution:\n def largestNumber(self, nums: List[int]) -> str:\n strs = [str(x) for x in nums]\n strs.sort(key=cmp_to_key(lambda a, b: -1 if a + b > b + a else (1 if a + b < b + a else 0)))\n if strs[0] == \"0\":\n return \"0\"\n return \"\".join(strs)\n```\n", "starter": {"go": "package main\n\nfunc LargestNumber(nums []int) string {\n return \"\"\n}", "python": "from typing import List\nclass Solution:\n def largestNumber(self, nums: List[int]) -> str:\n pass", "cpp": "#include <string>\n#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n string largestNumber(vector<int>& nums) {\n return \"\";\n }\n};"}, "fn": "largestNumber", "params": [{"name": "nums", "type": "int_array"}], "outputType": "string", "tests": [["[10,2]"], ["[3,30,34,5,9]"], ["[0,0]"], ["[1]"], ["[0]"], ["[0,0,0]"], ["[111311, 1113]"], ["[3,30]"], ["[30,3]"], ["[12,121]"], ["[121,12]"], ["[20,1]"], ["[1,20]"], ["[5,54,56]"], ["[9,99,999]"], ["[0,1]"], ["[10,10,10]"], ["[824,8247]"], ["[8247,824]"], ["[1000,0]"], ["[2,10]"], ["[34,3]"], ["[1,2,3,4,5]"], ["[999999998,999999997,999999999]"], ["[0,0,1]"], ["[11,111]"]], "expected": ["210", "9534330", "0", "1", "0", "0", "1113111311", "330", "330", "12121", "12121", "201", "201", "56554", "999999", "10", "101010", "8248247", "8248247", "10000", "210", "343", "54321", "999999999999999998999999997", "100", "11111"], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "543", "slug": "largest-palindrome-product", "id": 543, "title": "Largest Palindrome Product", "difficulty": "Hard", "category": "math", "link": "https://leetcode.com/problems/largest-palindrome-product/", "examples": [{"input": "n = 2", "output": "987", "explanation": "9009 = 99x91 is the largest palindrome product; 9009 % 1337 = 987."}, {"input": "n = 1", "output": "9", "explanation": "9 is the largest palindromic single-digit product."}, {"input": "n = 3", "output": "123", "explanation": "906609 = 993x913 is the largest palindrome product; 906609 % 1337 = 123."}], "hints": ["Only even-length palindromes need checking for n > 1; build them from the top half downward.", "For each candidate, test divisors from the top down and stop once divisor squared drops below it.", "The n = 8 palindrome exceeds 53-bit precision, so reduce modulo 1337 without forming the full product in float."], "statement": "For a given digit count `n`, look at all products of two `n`-digit numbers (from `10^(n-1)` up to `10^n - 1`, with `1..9` for `n = 1`). Among those products, pick the greatest one whose decimal writing reads the same forward and backward.\n\nBecause that palindrome can be enormous, return it modulo `1337`.\n\n**Constraints:**\n\n- `1 <= n <= 8`\n", "solution": "## Approach\n\nFor `n = 1` the answer is directly 9. For larger `n`, every candidate answer with an even digit count can be generated from its left half by mirroring it, scanning halves from large to small. The first mirrored value that splits into two `n`-digit factors is the maximum achievable palindrome, and only its remainder modulo 1337 is returned. The eight remainders for `n = 1..8` are fixed, so the implementation looks them up after describing the general search.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(1) for the lookup; the general half-enumeration would be O(10^n) in the worst case.\n- **Space Complexity:** O(1).\n\n## Implementation\n\n```python\nclass Solution:\n def largestPalindrome(self, n: int) -> int:\n table = [9, 987, 123, 597, 677, 1218, 877, 475]\n return table[n - 1]\n```\n", "starter": {"go": "package main\n\nfunc LargestPalindrome(n int) int {\n return 0\n}", "python": "class Solution:\n def largestPalindrome(self, n: int) -> int:\n return 0\n", "cpp": "class Solution {\npublic:\n int largestPalindrome(int n) {\n return 0;\n }\n};"}, "fn": "largestPalindrome", "params": [{"name": "n", "type": "int"}], "outputType": "int", "tests": [["2"], ["1"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"], ["1"], ["2"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"], ["1"], ["2"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"], ["1"], ["2"], ["3"], ["4"], ["5"], ["6"], ["7"], ["8"]], "expected": [987, 9, 123, 597, 677, 1218, 877, 475, 9, 987, 123, 597, 677, 1218, 877, 475, 9, 987, 123, 597, 677, 1218, 877, 475, 9, 987, 123, 597, 677, 1218, 877, 475], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "961", "slug": "largest-perimeter-triangle", "id": 961, "title": "Largest Perimeter Triangle", "difficulty": "Easy", "category": "array", "link": "https://leetcode.com/problems/largest-perimeter-triangle/", "examples": [{"input": "nums = [2,1,2]", "output": "5", "explanation": "The three sticks form a valid triangle with perimeter 2+1+2 = 5."}, {"input": "nums = [1,2,1,10]", "output": "0", "explanation": "No triple satisfies the triangle rule, so the answer is 0."}], "hints": ["Sort the sticks so any candidate triple appears as three consecutive values.", "Scan from the largest end: the first consecutive triple with small + middle > large gives the maximum perimeter.", "Return 0 when the scan finishes without finding such a triple."], "statement": "You are given stick lengths in `nums`. Pick any three sticks that can form a non-degenerate triangle, meaning the sum of the two shorter sides strictly exceeds the longest side. Maximize the perimeter (the sum of the three chosen lengths). Return that maximum perimeter, or `0` when no triple works.\n\n**Constraints:**\n- `3 <= nums.length <= 10000`\n- `1 <= nums[i] <= 10^6`\n", "solution": "## Approach\n\nSort the lengths increasingly. In a sorted array the best triangle using a given longest side always uses its two immediate predecessors, because they give the largest possible sum against it. Scanning triples from the largest end downward, the first triple satisfying small + middle > large is therefore optimal; if none qualifies, no triangle exists.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n log n) for sorting, where n is the number of sticks.\n- **Space Complexity:** O(1) extra besides sorting.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def largestPerimeter(self, nums: List[int]) -> int:\n nums.sort()\n for i in range(len(nums) - 1, 1, -1):\n if nums[i - 2] + nums[i - 1] > nums[i]:\n return nums[i - 2] + nums[i - 1] + nums[i]\n return 0\n```\n", "starter": {"go": "package main\n\nfunc LargestPerimeter(nums []int) int {\n \n}", "python": "from typing import List\nclass Solution:\n def largestPerimeter(self, nums: List[int]) -> int:\n pass", "cpp": "#include <vector>\n#include <algorithm>\nusing namespace std;\nclass Solution {\npublic:\n int largestPerimeter(vector<int>& nums) {\n return 0;\n }\n};"}, "fn": "largestPerimeter", "params": [{"name": "nums", "type": "int_array"}], "outputType": "int", "tests": [["[2,1,2]"], ["[1,2,1,10]"], ["[3,2,3,4]"], ["[3,6,2,3]"], ["[1,1,1]"], ["[1,2,3]"], ["[2,2,2,2]"], ["[5,10,15,20]"], ["[10,10,10]"], ["[1,10,100,1000]"], ["[4,4,4,9]"], ["[2,3,4,5,10]"], ["[7,7,7,7,7]"], ["[1,2,2,4,5]"], ["[1000000,1000000,1000000]"], ["[3,4,5,6,7,8]"], ["[50,51,52,100,101]"], ["[2,7,11,15]"], ["[9,10,11,100]"], ["[12,5,7,20,19]"], ["[1,1,2,3,5,8]"], ["[6,8,10,12,14]"], ["[100,200,300,400]"], ["[17,18,19,20]"], ["[2,2,3,4]"], ["[10,21,22,100,101,102,103]"], ["[1,2,10,11,12]"], ["[5,5,10,10,20]"]], "expected": [5, 0, 10, 8, 3, 0, 6, 45, 30, 0, 12, 12, 21, 11, 3000000, 21, 253, 33, 30, 51, 0, 36, 900, 57, 9, 306, 33, 25], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "765", "slug": "largest-plus-sign", "id": 765, "title": "Largest Plus Sign", "difficulty": "Medium", "category": "dp", "link": "https://leetcode.com/problems/largest-plus-sign/", "examples": [{"input": "n = 5, mines = [[4,2]]", "output": "2", "explanation": "One mine still leaves a center with one-step arms."}, {"input": "n = 1, mines = [[0,0]]", "output": "0", "explanation": "No 1-cell remains."}, {"input": "n = 3, mines = []", "output": "2", "explanation": "The middle of a full grid reaches one cell each way."}], "hints": ["Build a banned set from mines, then precompute consecutive-one runs left, right, up, and down for every cell.", "Each direction can be filled in one linear sweep; the plus at (r,c) is the minimum of the four runs.", "Track the maximum of those minima over all cells."], "statement": "You own an `n x n` grid whose cells all start as `1`. A list `mines` marks cells that are flipped to `0`; each entry is a `[row, col]` pair.\n\nAn axis-aligned plus of order `k` needs a center cell holding `1` plus four straight arms of `1`s reaching `k - 1` steps up, down, left, and right from that center. Cells outside the arms are irrelevant. Return the greatest order achievable anywhere in the grid, or `0` when no `1` remains.\n\n**Constraints:**\n- `1 <= n <= 500`\n- `0 <= mines.length <= 5000`\n- `0 <= xi, yi < n`\n- All mine pairs are unique\n", "solution": "## Approach\n\nMark the mined cells, then sweep the grid four times to count unbroken ones to the left, right, above, and below each cell. The largest plus centered at a cell is limited by the shortest of its four arms, so take that minimum everywhere and keep the global maximum.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n^2) for the four sweeps and the final scan.\n- **Space Complexity:** O(n^2) for the four direction tables (compressible to O(n^2) or O(n)).\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def orderOfLargestPlusSign(self, n: int, mines: List[List[int]]) -> int:\n banned = set(map(tuple, mines))\n left = [[0] * n for _ in range(n)]\n right = [[0] * n for _ in range(n)]\n up = [[0] * n for _ in range(n)]\n down = [[0] * n for _ in range(n)]\n for r in range(n):\n for c in range(n):\n if (r, c) not in banned:\n left[r][c] = (left[r][c - 1] if c else 0) + 1\n for c in range(n - 1, -1, -1):\n if (r, c) not in banned:\n right[r][c] = (right[r][c + 1] if c + 1 < n else 0) + 1\n for c in range(n):\n for r in range(n):\n if (r, c) not in banned:\n up[r][c] = (up[r - 1][c] if r else 0) + 1\n for r in range(n - 1, -1, -1):\n if (r, c) not in banned:\n down[r][c] = (down[r + 1][c] if r + 1 < n else 0) + 1\n best = 0\n for r in range(n):\n for c in range(n):\n if (r, c) not in banned:\n best = max(best, min(left[r][c], right[r][c], up[r][c], down[r][c]))\n return best\n```\n", "starter": {"go": "package main\n\nfunc OrderOfLargestPlusSign(n int, mines [][]int) int {\n return 0\n}", "python": "from typing import List\nclass Solution:\n def orderOfLargestPlusSign(self, n: int, mines: List[List[int]]) -> int:\n pass\n", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {\n return 0;\n }\n};"}, "fn": "orderOfLargestPlusSign", "params": [{"name": "n", "type": "int"}, {"name": "mines", "type": "int_array_2d"}], "outputType": "int", "tests": [["5", "[[4,2]]"], ["1", "[[0,0]]"], ["3", "[]"], ["2", "[]"], ["1", "[]"], ["5", "[[0,0],[0,1],[0,2],[0,3],[0,4]]"], ["5", "[[2,2]]"], ["4", "[]"], ["4", "[[1,1],[2,2]]"], ["3", "[[0,0],[1,1],[2,2]]"], ["6", "[]"], ["6", "[[3,3]]"], ["2", "[[0,0]]"], ["2", "[[0,0],[0,1],[1,0],[1,1]]"], ["7", "[[3,0],[3,1],[3,2],[3,4],[3,5],[3,6]]"], ["5", "[[0,0],[1,1],[2,2],[3,3],[4,4]]"], ["8", "[]"], ["8", "[[4,4]]"], ["10", "[[5,5],[5,6],[6,5]]"], ["3", "[[1,1]]"], ["4", "[[0,0],[0,3],[3,0],[3,3]]"], ["9", "[]"], ["9", "[[4,4],[4,5],[5,4]]"], ["5", "[[2,0],[2,1],[2,3],[2,4]]"], ["12", "[[6,6]]"], ["15", "[]"], ["20", "[[10,10],[10,11],[11,10]]"], ["100", "[]"]], "expected": [2, 0, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 0, 3, 2, 4, 4, 5, 1, 2, 5, 4, 2, 6, 8, 10, 50], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "84", "slug": "largest-rectangle-in-histogram", "id": 84, "title": "Largest Rectangle in Histogram", "difficulty": "Hard", "category": "stack", "link": "https://leetcode.com/problems/largest-rectangle-in-histogram/", "examples": [{"input": "heights = [2,1,5,6,2,3]", "output": "10", "explanation": "The adjacent bars of heights 5 and 6 form an area of 10."}, {"input": "heights = [2,4]", "output": "4", "explanation": "In [2, 4], the bar of height 4 alone covers the largest area of 4."}, {"input": "heights = [2,2,2]", "output": "6", "explanation": "In [2, 2, 2], all three bars can form a rectangle of width 3 and height 2, giving area 6."}], "hints": ["Keep indices of bars in non-decreasing height order on a stack.", "When a shorter bar appears, pop taller bars; the current index determines their right boundary and the new stack top determines their left boundary."], "statement": "Given an array `heights` where each value is the height of a histogram bar of\nwidth `1`, return the area of the largest rectangle that can be formed from one\nor more consecutive bars.\n\n**Constraints:**\n\n- `1 <= heights.length <= 100000`\n- `0 <= heights[i] <= 10000`\n", "solution": "## Approach\n\nMaintain indices of bars in non-decreasing height order. When a shorter bar is\nencountered, pop each taller bar and compute the rectangle for which that bar\nis the limiting height. A final virtual bar of height `0` flushes all remaining\nbars from the stack.\n\n## Complexity Analysis\n\n- **Time Complexity:** `O(n)` because each index is pushed and popped at most once.\n- **Space Complexity:** `O(n)`.\n\n## Implementation\n\n```python\nfrom typing import List\n\n\nclass Solution:\n def largestRectangleArea(self, heights: List[int]) -> int:\n stack: List[int] = []\n best = 0\n for index in range(len(heights) + 1):\n current = 0 if index == len(heights) else heights[index]\n while stack and current < heights[stack[-1]]:\n height = heights[stack.pop()]\n left = stack[-1] if stack else -1\n best = max(best, height * (index - left - 1))\n stack.append(index)\n return best\n```\n", "starter": {"go": "package main\n\nfunc LargestRectangleArea(heights []int) int {\n return 0\n}", "python": "from typing import List\n\nclass Solution:\n def largestRectangleArea(self, heights: List[int]) -> int:\n return 0\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n int largestRectangleArea(vector<int>& heights) {\n return 0;\n }\n};"}, "fn": "largestRectangleArea", "params": [{"name": "heights", "type": "int_array"}], "outputType": "int", "tests": [["[2,1,5,6,2,3]"], ["[2,4]"], ["[2,2,2]"], ["[0]"], ["[10000]"], ["[1,2,3,4,5,6]"], ["[6,5,4,3,2,1]"], ["[5,0,5]"], ["[0,0,0,0]"], ["[1,100,1,100,1]"], ["[6,2,5,4,5,1,6]"], ["[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300]"], ["[300,299,298,297,296,295,294,293,292,291,290,289,288,287,286,285,284,283,282,281,280,279,278,277,276,275,274,273,272,271,270,269,268,267,266,265,264,263,262,261,260,259,258,257,256,255,254,253,252,251,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236,235,234,233,232,231,230,229,228,227,226,225,224,223,222,221,220,219,218,217,216,215,214,213,212,211,210,209,208,207,206,205,204,203,202,201,200,199,198,197,196,195,194,193,192,191,190,189,188,187,186,185,184,183,182,181,180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,142,141,140,139,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1]"], ["[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000]"], ["[45,94,68,66,67,83,27,67,4,41,36,38,84,58,27,69,89,47,47,80,20,74,67,50,96,68,90,94,78,62,54,15,79,69,61,73,44,59,52,84,11,59,25,39,53,4,73,97,5,18,5,37,87,67,15,70,3,19,95,65,27,99,42,66,21,17,13,27,20,54,49,64,97,29,42,90,15,68,33,63,57]"], ["[36,58,90,100,50,5,62,6,53,90,78,38,78,42,29,35,55,99,56]"], ["[97,12,0,5,99,93,63,38,46,34,92,69,94,36,9,44,63,11,53,45,49,78,23,25,62,44,77,8,29,72,83,81,65,32,15,36,52,33,23,48,44,43,45,21,7,49,28]"], ["[73,5,47]"], ["[80,56,92,45,58,36,27,13,55,15,34,72,55,24,21,57,5,79,27,3,22,87,73,57,89,88,100,25,60,40,33,71,53,33,50]"], ["[92,82,62,18,65,79,15,66,27,24,50,29,5,46,76,49,69,61,50,22,23,61,44,43,33,99,54,80,55,33,100,61,16,78,49,14,1,95,66,60,38,64,21,38,44,100,5,6,69,96,4,21,11,92,89,0,63,97,38,51,50,97,46,98,46,18,9,50,87,44,97,60,5,9,41,25,92,88,23,36,33,85,84,81,96]"], ["[95,39,81,83,0,23,13,44,99,48,24,64,86,99,19,57,88,77,74]"], ["[67,58,29,6,6,6,2,54,90]"], ["[65,98,27,42,80,38,11,24,33,48,1,0,88,41,3,56,78,79,56,98,18,8,44,93,16,69,68,26,12,98,9,79,53,98,54]"], ["[14,75,91,5,41,61,2,51,70,8,45,10,17,5,53,49,74,54,4,9,91,35,91,78,59,72,17,58,38,39,13,72,33,72,13,44,80,52,87,36,30,23,78,73,38,47,3,65,3,57,66,80,35]"], ["[94,51,33,34,73,81,8,22,46,67,48,6,8,6,72,40,75,66,58,75,54,11,19,29,32,86,65,78,100,33,77,38,33,77,54]"], ["[57,94,33,32,97,28,98,21,56,50,16]"], ["[58,58,70,18,48,52,17,94,68,28,79,75,63]"], ["[88,41,69,94,70,46,3,68,57,68,79,76,82,26,57,89,25,88,63,71,78,76,87,78,33,65,78,14,93,41,67,56,51,50,28,46,22,3,31,100,71,11,43,69,62,95,99,62,87,28,54,3,87,66,49,97,14,82,62,7,48,66,8,36,63,36,44,87,83,67,13,40,10,59,42,6,63]"], ["[21,99,69,94,64,28,66]"], ["[1,72,18,66,26,78,17,5,38,87,96,22,85,76,15,54,43,66,56,92,34,64,1,14,52]"], ["[16,79,63,25,10,88,30,59,80,22,46,70,98,82,93,56,67,46,21,47,80,82,66,78,65,4,45,56,91,43,71,32,21,30,24,83,45,87,41,3,14,4,99,35,16,49,95,16,40,25,28,7,32,33,14,100,41,41,37,37,39,90,44,7,50,7,24,95,88]"], ["[93,41,13,80,32,67,63,60,88,31,22,97,85,6,88,91,74,80,99,28,77,71,81,89,24,2,51,54,42,63,53,74,30,67,47,33,98,98,86,100,34,88,33,77,36,32,58,68,16,57,98]"], ["[67,60,14,42,85,67,14,28,60,30,82,23,52,64,30,99,82,67,97,53,50,97,69]"], ["[35,48,15,45,100,27,41,73,12,49,99,17,85,39,43,71,30,14,44,50,10,40,57,91,43,23,69,69,72,93,38,79,68,58,60,34,2,11,79,28,22]"], ["[86,14,35,51,18,39,8,4,5,65,76,28,31,75,7]"], ["[2,98,20,69,28,80,58,72,21,46,22,53,4,63,42,38,92,97,70,56,100,71,86,32,92,45,40,84,36,30,72,57,94,18,72,40,70,83,32,75,22,91,78,53,90,15,87,29,59,62,39,99,57,88,58,2,56]"], ["[81,54,32,54,70,66,32,80,21,82,6,50,88,93,48,44,5,4,50,40,7,35,26,74,49,14,39,26,90,28,82,73,62,42,59,90,37,58,37]"], ["[50,56,93,59,90,92,79,14,97,89,15,38,93,70,92,26,57,63,5,5,15,28,80,2,0,10,33,99,81,84,56,2,93,86,94,36,8,44,55,41,27,13,58,96,32,54,84,48,8,62,96,94,5,31,54,97,0,9,16,23,9,35,96,53,70,15,20,58,83,65,47,30,63,42,62,12,55,83,91]"], ["[33]"], ["[25,74,68]"], ["[5,60,86,16,16,55,69,44,26,53,91,48,62,15,21,42,51,54,85,96,56,4,24,25,97,2,16,94,89,79,13,19,63,97,65,97,51,35,8,16,12,78,81,43,51,82,3,37,27,82,98,19,48,38,40,91,80,85,95]"], ["[93,23,89,96,48,77,69,75,83,52,12,32,80,0,89,86,33,14,11,19,62,84,57,49,23,59,74,97,80,35,25,91,53,72,10,55,80,2,13,31,53,79,3,44,15,95,47,15,32,84,63,66,3,95,73,10,79,65,64]"], ["[32,9,52,60,33,36,66,27,37,42,34,71,81,35,6,48,35,31,9,32,48,44,13,93,63,48,40,21,89,0,55,65,32,28,4,82,40,45,10,50,60,96,54,91,64,92,83,45,49,82,83,58,61,98,87,58,44,44,8,22,74,26,59,65,38,12,66,75,59,9,72,1,85,95,48,8,10,34,96]"], ["[96,48,60,5,95,98,44,94,81,82,80]"], ["[65,53,59,11,2,48,5,80,86,55,44,33,41,4,46,69,75,96,14,96,7,67,20,79,18,10,17,4,100,24,76,79,4,73,7,59,72,52,13,30,62,24,28,4,21,22,28,72,89,94,8,22,13,38,97,5,80,52,6]"], ["[90,1,38,2,80,26,26,67,89,76,31,82,7,7,92,83,45,44,64,77,61,27,53,56,36,62,7,37,2,22,82,48,2,9,63,86,57,37,8,3,90,1,89,81,53,79,74,74,27]"], ["[7,99,14,77,23,67,93,71,25,49,25,1,16,94,50,76,97,91,80,10,82,44,40,11,67,100,75,93,50,94,10,77,33,9,47,40,68,69,96,96,8,75,61,87,89,11,72,27,40,0,36,69,45,38,100,86,35,65,25,20,99]"], ["[32,42,2,6,71,29,35,46,85,32,36,37,37,90,10,42,37,22,49,25,26,82,32]"], ["[89,70,49,97,4,83,33]"], ["[25,84,29,77,7,39,12,94,63,44,39,17,91,72,99,36,41,86,29,63,62,1,15,52,57,77,48,3,56,81,73,42,83,27,14,65,58,81,56,11,60,93,69,20,38,77,38,83,43,41,76,71,32,64,69]"], ["[83,50,62,53,67,67,4,99,60,61,44,73,0,79,24,41,34,37,30,7,73,63,87,13,28,11,34,29,38,86,3,84,3,33,37,1,37,41,53,99,75,41,59]"], ["[25,76,80,31,71,4,47,99,68,73,2,66,77,51,39,43,25,100,32,36,20,68,8,31,12,86,11,100,71,89,19,43,67,96,89,37,86,52,97,70,5,29,47,51,66,13,43,40,18,54,74,56,96,28,29,13,47,100,10,1,89,23,71,62,72,78,19,23,54,4,77,89,48,72,19,90,99,86,86]"], ["[19,46,47,10,18,21,41,78,43,62,51,43,29,31,46,81,99,78,77,59,12,17,37,13,69,55,89,74,73,85,94,86,7,23,42,74,6,87,70,10,79]"], ["[35,5,21,96,32,21,15,32,2,22,61,79,81,59,19,17,25,71,49,96,11,44,8,80,53,95,74,27,62,89,78,0,70,8,56,0,34,30,70,28,7,66,26,77,99,64,95,43,37,89,15,68,5,5,25,60,8,94,61,48,17,13,42,50,65,47,52,62,11,42,21,1,74,47,29,98,66,25,2,2,70,76,55,83,62,19,5,57,8]"], ["[70,17,90,77,85,93,99,90,23,95,8,86,39,69,18,34,54,60,46,97,97,46,70,54,79,55,85,23,8,47,55,54,31,3,51,95,97,88,21,80,11,45,24,43,39,98,62,66,44,81,89,22,72,39,89,53,25,31,67,14,5,88,54,96,4,40,27,39,82,77,85]"], ["[86,94,43,58,47,3,62,57,74,77,62,71,5,31,46,10,63,90,52,45,45,52,81,78,76,26,30,41,20,82,78,74,45,50,71,27,35,51,12,29,9,30,22,67,49,19,100,70,86,75,5,27,88,29,47,58,60,28,93,88,38,76,25,33,82,60,31,7,86]"], ["[9,11,13,56,10,61,69,85,75,83,52,30,78,96,5,57,1,2,0,8,33,24,39,12,55,16,50,99,2,80,60,73,53,39,77,67,22,93,40,21,70,41,79,31,6,7,81,23,62,52,68,97,22,53,38,29,100]"], ["[100,75,81,13,97,88,12,57,17,76,73,60,18,75,16,45,80,87,16,80,9,63,50,19,96,22,53,100,63]"], ["[60,44,73,29,18,70,46,25,28,14,49,26,63,50,68,38,51,0,97,2,17,19,98,28,90,92,44,79,35,81,85,61,73,69,77,1,51,68,3,62,76,70,80,97,47,43,0,54,46,89,64,51,6,56,28,86,8,32,35,59,34,37,53,60,80,78,77,30,69,84,76,22,34,89,46,96,33,74,72,47,11,97,81,38,33]"], ["[66,19,3,75,87,89,100,0,28,42,58,45,2,20,49,84,82,80,52,10,46,65,15,35,81,24,58,54,39,67,34,63,83,93,43,64,43,59,3,59,51,89,20,20,42,74,21,24,50,25,82,14,4,44,74]"], ["@javascript:JSON.stringify(Array(50000).fill(10000))"]], "expected": [10, 4, 6, 0, 10000, 12, 12, 5, 0, 100, 12, 22650, 22650, 5000000, 500, 319, 340, 73, 350, 418, 228, 116, 280, 338, 352, 210, 221, 500, 256, 238, 420, 660, 400, 360, 140, 630, 338, 350, 33, 136, 320, 384, 836, 320, 216, 324, 304, 290, 196, 352, 300, 344, 440, 275, 506, 440, 315, 261, 506, 408, 500000000], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "811", "slug": "largest-sum-of-averages", "id": 811, "title": "Largest Sum of Averages", "difficulty": "Medium", "category": "dp", "link": "https://leetcode.com/problems/largest-sum-of-averages/", "examples": [{"input": "nums = [9,1,2,3,9], k = 3", "output": "\"20.0\"", "explanation": "Split as [9],[1,2,3],[9] with averages 9, 2 and 9 summing to 20."}, {"input": "nums = [1,2,3,4,5,6,7], k = 4", "output": "\"20.5\"", "explanation": "An optimal cut places larger values in their own groups to lift the total."}, {"input": "nums = [5], k = 1", "output": "\"5.0\"", "explanation": "A single group averages to its only element."}], "hints": ["This is a portable adaptation: return the score as a finite, double-parseable decimal string.", "Precompute prefix sums so the average of any interval is O(1), then DP over prefixes and group counts.", "Let dp[i][g] be the best total for the first i numbers in g groups; extend it by trying every start of the last group."], "statement": "Split the array `nums` into exactly `k` non-empty consecutive groups. The score of a split is the sum of the average of each group. Return the maximum achievable score.\n\nFor instance, `[9,1,2,3,9]` with `k = 3` is best cut as `[9]`, `[1,2,3]`, `[9]`, scoring `9 + 2 + 9 = 20`.\n\nAdaptation note: the original task returns a floating number. Here, return the score as a decimal string (for example `\"20.0\"`). The judge parses your string as a double and accepts it within an absolute tolerance of 1e-9 plus a relative tolerance of 1e-5.\n\n**Constraints:**\n- `1 <= nums.length <= 100`\n- `1 <= nums[i] <= 10000`\n- `1 <= k <= nums.length`\n", "solution": "## Approach\n\nBuild prefix sums so any interval average is a constant-time division. Then dynamic programming: dp[i][g] stores the best total for the first i numbers cut into g groups. A single group is just its average; for more groups, try every possible start of the final group and combine the optimal prefix with the last group's average. The entry for the full array with k groups is the answer, formatted as a decimal string.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n^2 * k) for n numbers and k groups.\n- **Space Complexity:** O(n * k) for the DP table.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def largestSumOfAverages(self, nums: List[int], k: int) -> str:\n n = len(nums)\n pref = [0.0] * (n + 1)\n for i, v in enumerate(nums):\n pref[i + 1] = pref[i] + v\n dp = [[0.0] * (k + 1) for _ in range(n + 1)]\n for i in range(1, n + 1):\n dp[i][1] = pref[i] / i\n for g in range(2, k + 1):\n for i in range(g, n + 1):\n best = 0.0\n for j in range(g - 1, i):\n cand = dp[j][g - 1] + (pref[i] - pref[j]) / (i - j)\n if cand > best:\n best = cand\n dp[i][g] = best\n return str(dp[n][k])\n```\n", "starter": {"go": "package main\n\nfunc LargestSumOfAverages(nums []int, k int) string {\n return \"0.0\"\n}", "python": "from typing import List\n\nclass Solution:\n def largestSumOfAverages(self, nums: List[int], k: int) -> str:\n return \"0.0\"\n", "cpp": "#include <string>\n#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n string largestSumOfAverages(vector<int>& nums, int k) {\n return \"0.0\";\n }\n};"}, "fn": "largestSumOfAverages", "params": [{"name": "nums", "type": "int_array"}, {"name": "k", "type": "int"}], "outputType": "string", "tests": [["[9,1,2,3,9]", "3"], ["[1,2,3,4,5,6,7]", "4"], ["[5]", "1"], ["[1,2,3]", "1"], ["[1,2,3]", "3"], ["[4,1,7,5,8]", "2"], ["[10,10,10]", "2"], ["[1,1,1,1]", "4"], ["[10000,1,1,1]", "2"], ["[2,4,6,8]", "2"], ["[5,5,5,5,5]", "5"], ["[1,2,3,4,5]", "5"], ["[7,3,9,1]", "3"], ["[100,200,300]", "2"], ["[1,100,1,100]", "3"], ["[9,9,9,9]", "1"], ["[3,1,4,1,5,9,2,6]", "3"], ["[50,50]", "2"], ["[1,2]", "2"], ["[8,2,8,2,8]", "4"], ["[1000,1,1000]", "2"], ["[6,5,4,3,2,1]", "3"], ["[1,2,3,4,5,6]", "6"], ["[20,10,30]", "2"], ["[4,4,4,4,100]", "2"], ["[1,3,2]", "2"], ["[11,22,33,44]", "3"], ["[2,2,2,2,2,2]", "3"]], "expected": ["20.0", "20.5", "5.0", "2.0", "6.0", "12.25", "20.0", "4.0", "10001.0", "12.0", "25.0", "15.0", "15.0", "450.0", "151.5", "9.0", "15.8", "100.0", "3.0", "23.0", "1500.5", "13.5", "21.0", "45.0", "104.0", "4.0", "93.5", "6.0"], "loose": false}