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": "13", "slug": "counting-bits", "id": 13, "title": "Counting Bits", "difficulty": "Easy", "category": "binary", "link": "https://leetcode.com/problems/counting-bits/", "examples": [{"input": "n = 2", "output": "[0,1,1]", "explanation": "For numbers 0 through 2, the counts of 1-bits in their binary representations are [0, 1, 1]."}, {"input": "n = 5", "output": "[0,1,1,2,1,2]", "explanation": "For numbers 0 through 5, the counts of 1-bits in their binary representations are [0, 1, 1, 2, 1, 2]."}], "hints": ["Use DP: `ans[i] = ans[i >> 1] + (i & 1)`."], "statement": "You are given a non-negative integer `n`. Produce an array `ans` with `n + 1` slots, where slot `i` (for each `0 <= i <= n`) stores how many `1` bits occur in the binary form of `i`.\n\n**Constraints:**\n- `0 <= n <= 10^5`\n", "solution": "## Approach\n\nDP where the number of 1-bits in i is the number in i//2 plus the least significant bit.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n)\n- **Space Complexity:** O(n)\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def countBits(self, n: int) -> List[int]:\n dp = [0] * (n + 1)\n for i in range(1, n + 1):\n dp[i] = dp[i >> 1] + (i & 1)\n return dp\n```\n", "starter": {"go": "package main\n\nfunc CountBits(n int) []int {\n \n}", "python": "class Solution:\n def countBits(self, n: int) -> list[int]:\n pass\n", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n vector<int> countBits(int n) {\n return {};\n }\n};"}, "fn": "countBits", "params": [{"name": "n", "type": "int"}], "outputType": "int_array", "tests": [["0"], ["1"], ["2"], ["5"], ["16"], ["31"], ["100"], ["3"], ["4"], ["6"], ["7"], ["8"], ["9"], ["10"], ["11"], ["12"], ["13"], ["14"], ["15"], ["17"], ["32"], ["63"], ["64"], ["65"], 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7, 5, 6, 6, 7, 6, 7, 7, 8, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 7, 8, 8, 9, 8, 9, 9, 10, 8, 9, 9, 10, 9, 10, 10, 11, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, 5]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "766", "slug": "couples-holding-hands", "id": 766, "title": "Couples Holding Hands", "difficulty": "Hard", "category": "greedy", "link": "https://leetcode.com/problems/couples-holding-hands/", "examples": [{"input": "row = [0,2,1,3]", "output": "1", "explanation": "Swap chairs 1 and 2 to line up both couples."}, {"input": "row = [3,2,0,1]", "output": "0", "explanation": "Every adjacent pair is already a couple."}, {"input": "row = [2,3,1,0]", "output": "0", "explanation": "Reversed pairs still count as together."}], "hints": ["Keep a position table from person to chair so the partner of any seat is found instantly.", "Walk the couches left to right: if chair 2k+1 does not hold the partner of chair 2k, swap that partner into place.", "Each such swap fixes at least one couple and never harms an earlier couch, so the count is minimal."], "statement": "There are `n` couples seated in one row of `2n` chairs. Chair `i` holds person `row[i]`. Couples are numbered in order: `(0,1)`, `(2,3)`, and so on up to `(2n-2,2n-1)`.\n\nOne swap exchanges any two people. Return the smallest number of swaps that places every couple in neighboring chairs. Neighbors are pairs `(0,1)`, `(2,3)`, and so forth; the order inside a pair does not matter.\n\n**Constraints:**\n- `2 <= row.length <= 60` and `row.length` is even\n- `0 <= row[i] < row.length`\n- All values in `row` are distinct\n", "solution": "## Approach\n\nIndex every person to their current chair, then fix the couches from left to right. For the couch starting at an even chair, look up where the partner of its first occupant sits; if they are not already together, swap that partner next to them. Each swap settles the current couch without disturbing earlier ones, which keeps the total minimal.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), where n is the row length, for one linear pass with constant-time swaps.\n- **Space Complexity:** O(n) for the position table.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def minSwapsCouples(self, row: List[int]) -> int:\n pos = {v: i for i, v in enumerate(row)}\n swaps = 0\n for i in range(0, len(row), 2):\n partner = row[i] + 1 if row[i] % 2 == 0 else row[i] - 1\n if row[i + 1] == partner:\n continue\n j = pos[partner]\n tmp = row[i + 1]\n row[i + 1], row[j] = row[j], tmp\n pos[tmp] = j\n pos[partner] = i + 1\n swaps += 1\n return swaps\n```\n", "starter": {"go": "package main\n\nfunc MinSwapsCouples(row []int) int {\n return 0\n}", "python": "from typing import List\nclass Solution:\n def minSwapsCouples(self, row: List[int]) -> int:\n pass\n", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int minSwapsCouples(vector<int>& row) {\n return 0;\n }\n};"}, "fn": "minSwapsCouples", "params": [{"name": "row", "type": "int_array"}], "outputType": "int", "tests": [["[0,2,1,3]"], ["[3,2,0,1]"], ["[2,3,1,0]"], ["[1,0]"], ["[0,1]"], ["[1,2,0,3]"], ["[2,0,1,3]"], ["[0,3,2,1]"], ["[3,1,0,2]"], ["[5,4,2,6,3,1,0,7]"], ["[0,1,2,3]"], ["[1,0,3,2]"], ["[2,3,0,1]"], ["[4,5,6,7,0,1,2,3]"], ["[7,6,5,4,3,2,1,0]"], ["[0,2,4,6,1,3,5,7]"], ["[1,3,5,7,0,2,4,6]"], ["[2,1,0,3]"], ["[3,0,1,2]"], ["[4,1,0,3,2,5]"], ["[5,3,4,0,2,1]"], ["[6,2,4,0,5,3,1,7]"], ["[0,1,3,2,5,4]"], ["[1,4,0,3,2,5]"], ["[8,4,6,2,0,1,3,5,7,9]"], ["[9,8,7,6,5,4,3,2,1,0]"], ["[0,4,1,5,2,6,3,7]"], ["[3,2,1,0,5,4]"]], "expected": [1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 2, 2, 1, 1, 2, 2, 3, 0, 2, 3, 0, 2, 0], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "119", "slug": "course-schedule-ii", "id": 119, "title": "Course Schedule II", "difficulty": "Medium", "category": "graph", "link": "https://leetcode.com/problems/course-schedule-ii/", "examples": [{"input": "numCourses = 2, prerequisites = [[1,0]]", "output": "[0,1]", "explanation": "Course 0 has no prerequisites, and course 1 requires course 0, so a valid ordering is [0,1]."}, {"input": "numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]", "output": "[0,2,1,3]", "explanation": "[0,1,2,3] is another valid ordering."}, {"input": "numCourses = 2, prerequisites = [[1,0],[0,1]]", "output": "[]", "explanation": "A cycle exists in the prerequisites, so no valid ordering of 2 courses exists."}], "hints": ["Treat each prerequisite as a directed edge from the prerequisite to the course.", "Kahn's algorithm repeatedly takes a course with indegree zero. If fewer than numCourses courses are taken, a cycle exists.", "The returned order need not match a particular example; every prerequisite only needs to appear before its dependent course."], "statement": "There are `numCourses` subjects numbered `0` through `numCourses - 1`. Every entry `prerequisites[i] = [course, prerequisite]` states that `course` may only be taken after `prerequisite` has been finished.\n\nProduce any sequence in which every subject can be finished while respecting those requirements. When several valid sequences exist, any one of them is accepted. When the requirements loop back on themselves so that no complete sequence is possible, return an empty array.\n\n**Constraints:**\n- `1 <= numCourses <= 2000`\n- `0 <= prerequisites.length <= numCourses * (numCourses - 1)`\n- `prerequisites[i].length == 2`\n- `0 <= course, prerequisite < numCourses`\n- `course != prerequisite`\n- All prerequisite pairs are unique.\n", "solution": "## Approach\n\nTreat every prerequisite pair as a directed edge from the prerequisite to the course. Kahn's algorithm repeatedly appends an indegree-zero course to the answer and removes its outgoing edges. If fewer than `numCourses` courses are processed, a cycle prevents a valid ordering.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(V + E), where V is `numCourses` and E is the number of prerequisite pairs.\n- **Space Complexity:** O(V + E) for the graph, indegrees, queue, and result.\n\n## Implementation\n\n```python\nfrom collections import deque\nfrom typing import List\n\n\nclass Solution:\n def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]:\n graph = [[] for _ in range(numCourses)]\n indegree = [0] * numCourses\n for course, prerequisite in prerequisites:\n graph[prerequisite].append(course)\n indegree[course] += 1\n\n ready = deque(course for course in range(numCourses) if indegree[course] == 0)\n order = []\n while ready:\n course = ready.popleft()\n order.append(course)\n for next_course in graph[course]:\n indegree[next_course] -= 1\n if indegree[next_course] == 0:\n ready.append(next_course)\n\n return order if len(order) == numCourses else []\n```\n", "starter": {"go": "package main\n\nfunc FindOrder(numCourses int, prerequisites [][]int) []int {\n return nil\n}\n", "python": "from typing import List\n\nclass Solution:\n def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]:\n return []\n", "cpp": "#include <vector>\nusing namespace std;\n\nclass Solution {\npublic:\n vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {\n return {};\n }\n};"}, "fn": "findOrder", "params": [{"name": "numCourses", "type": "int"}, {"name": "prerequisites", "type": "int_array_2d"}], "outputType": "int_array", "tests": [["1", "[]"], ["2", "[]"], ["2", "[[1,0]]"], ["2", "[[0,1]]"], ["2", "[[1,0],[0,1]]"], ["3", "[[1,0],[2,1]]"], ["3", "[[1,2],[0,1]]"], ["3", "[[1,0],[2,0]]"], ["3", "[[2,0],[2,1]]"], ["3", "[[1,0],[2,1],[0,2]]"], ["3", "[[1,0],[0,1]]"], ["4", "[[1,0],[2,1],[3,2]]"], ["4", "[[1,0],[2,0],[3,0]]"], ["4", "[[0,3],[1,3],[2,3]]"], ["4", "[[1,0],[2,0],[3,1],[3,2]]"], ["4", "[[1,0],[2,1],[3,2],[0,3]]"], ["4", "[[1,0],[0,1],[3,2]]"], ["4", "[[1,0],[3,2]]"], ["4", "[[1,0],[0,1],[2,3],[3,2]]"], ["4", "[[2,0],[2,1],[3,1],[3,2]]"], ["5", "[]"], ["5", "[[1,0],[2,1],[3,2],[4,3]]"], ["5", "[[4,0],[4,1],[4,2],[4,3]]"], ["5", "[[1,4],[2,4],[3,1],[3,2]]"], ["5", "[[1,0],[2,0],[3,1],[3,2],[4,3]]"], ["5", "[[1,0],[2,1],[0,2],[4,3]]"], ["5", "[[1,0],[2,1],[3,2],[1,3]]"], ["5", "[[2,0],[2,1],[3,0],[3,1],[4,2],[4,3]]"], ["5", "[[0,4],[1,4],[2,0],[2,1],[3,2]]"], ["5", "[[1,0],[2,0],[3,0],[4,1],[4,2],[4,3]]"], ["6", "[[1,0],[2,1],[3,2],[4,3],[5,4]]"], ["6", "[[1,0],[2,0],[3,1],[4,1],[5,2]]"], ["6", "[[2,0],[2,1],[4,2],[5,3],[5,4]]"], ["6", "[[1,0],[2,1],[0,2],[4,3],[5,4]]"], ["6", "[[1,0],[2,1],[3,2],[4,3],[5,4],[2,5]]"], ["6", "[[3,0],[3,1],[3,2],[4,3],[5,3]]"], ["6", "[[1,0],[2,0],[3,1],[3,2],[4,1],[4,2],[5,3],[5,4]]"], ["7", "[[1,0],[2,0],[3,1],[4,1],[5,2],[6,2]]"], ["7", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[0,6]]"], ["7", "[[2,0],[2,1],[4,2],[4,3],[6,4],[6,5]]"], ["7", "[[1,0],[3,2],[5,4],[6,5]]"], ["8", "[[1,0],[2,0],[3,1],[4,1],[5,2],[6,2],[7,3],[7,4],[7,5],[7,6]]"], ["8", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[3,7]]"], ["8", "[[2,0],[3,0],[4,1],[5,1],[6,2],[6,4],[7,3],[7,5]]"], ["9", "[[1,0],[2,0],[3,1],[4,1],[5,2],[6,2],[7,3],[7,4],[8,5],[8,6]]"], ["9", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[0,8]]"], ["10", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]]"], ["10", "[[2,0],[2,1],[3,1],[4,2],[5,2],[6,3],[6,4],[7,5],[8,6],[9,7],[9,8]]"], ["10", "[[1,0],[2,1],[0,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8]]"], ["12", "[[1,0],[2,0],[3,1],[4,1],[5,2],[6,2],[7,3],[8,4],[9,5],[10,6],[11,7],[11,8],[11,9],[11,10]]"], ["12", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8],[10,9],[11,10],[5,11]]"], ["15", "[[2,0],[2,1],[5,2],[5,3],[5,4],[8,5],[8,6],[8,7],[11,8],[11,9],[11,10],[14,11],[14,12],[14,13]]"], ["20", "[[1,0],[3,2],[5,4],[7,6],[9,8],[11,10],[13,12],[15,14],[17,16],[19,18],[2,0],[4,2],[6,4],[8,6],[10,8],[12,10],[14,12],[16,14],[18,16]]"], ["2000", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6],[8,7],[9,8],[10,9],[11,10],[12,11],[13,12],[14,13],[15,14],[16,15],[17,16],[18,17],[19,18],[20,19],[21,20],[22,21],[23,22],[24,23],[25,24],[26,25],[27,26],[28,27],[29,28],[30,29],[31,30],[32,31],[33,32],[34,33],[35,34],[36,35],[37,36],[38,37],[39,38],[40,39],[41,40],[42,41],[43,42],[44,43],[45,44],[46,45],[47,46],[48,47],[49,48],[50,49],[51,50],[52,51],[53,52],[54,53],[55,54],[56,55],[57,56],[58,57],[59,58],[60,59],[61,60],[62,61],[63,62],[64,63],[65,64],[66,65],[67,66],[68,67],[69,68],[70,69],[71,70],[72,71],[73,72],[74,73],[75,74],[76,75],[77,76],[78,77],[79,78],[80,79],[81,80],[82,81],[83,82],[84,83],[85,84],[86,85],[87,86],[88,87],[89,88],[90,89],[91,90],[92,91],[93,92],[94,93],[95,94],[96,95],[97,96],[98,97],[99,98],[100,99],[101,100],[102,101],[103,102],[104,103],[105,104],[106,105],[107,106],[108,107],[109,108],[110,109],[111,110],[112,111],[113,112],[114,113],[115,114],[116,115],[117,116],[118,117],[119,118],[120,119],[121,120],[122,121],[123,122],[124,123],[125,124],[126,125],[127,126],[128,127],[129,128],[130,129],[131,130],[132,131],[133,132],[134,133],[135,134],[136,135],[137,136],[138,137],[139,138],[140,139],[141,140],[142,141],[143,142],[144,143],[145,144],[146,145],[147,146],[148,147],[149,148],[150,149],[151,150],[152,151],[153,152],[154,153],[155,154],[156,155],[157,156],[158,157],[159,158],[160,159],[161,160],[162,161],[163,162],[164,163],[165,164],[166,165],[167,166],[168,167],[169,168],[170,169],[171,170],[172,171],[173,172],[174,173],[175,174],[176,175],[177,176],[178,177],[179,178],[180,179],[181,180],[182,181],[183,182],[184,183],[185,184],[186,185],[187,186],[188,187],[189,188],[190,189],[191,190],[192,191],[193,192],[194,193],[195,194],[196,195],[197,196],[198,197],[199,198],[200,199],[201,200],[202,201],[203,202],[204,203],[205,204],[206,205],[207,206],[208,207],[209,208],[210,209],[211,210],[212,211],[213,212],[214,213],[215,214],[216,215],[217,216],[218,217],[219,218],[220,219],[221,220],[222,221],[223,222],[224,223],[225,224],[226,225],[227,226],[228,227],[229,228],[230,229],[231,230],[232,231],[233,232],[234,233],[235,234],[236,235],[237,236],[238,237],[239,238],[240,239],[241,240],[242,241],[243,242],[244,243],[245,244],[246,245],[247,246],[248,247],[249,248],[250,249],[251,250],[252,251],[253,252],[254,253],[255,254],[256,255],[257,256],[258,257],[259,258],[260,259],[261,260],[262,261],[263,262],[264,263],[265,264],[266,265],[267,266],[268,267],[269,268],[270,269],[271,270],[272,271],[273,272],[274,273],[275,274],[276,275],[277,276],[278,277],[279,278],[280,279],[281,280],[282,281],[283,282],[284,283],[285,284],[286,285],[287,286],[288,287],[289,288],[290,289],[291,290],[292,291],[293,292],[294,293],[295,294],[296,295],[297,296],[298,297],[299,298],[300,299],[301,300],[302,301],[303,302],[304,303],[305,304],[306,305],[307,306],[308,307],[309,308],[310,309],[311,310],[312,311],[313,312],[314,313],[315,314],[316,315],[317,316],[318,317],[319,318],[320,319],[321,320],[322,321],[323,322],[324,323],[325,324],[326,325],[327,326],[328,327],[329,328],[330,329],[331,330],[332,331],[333,332],[334,333],[335,334],[336,335],[337,336],[338,337],[339,338],[340,339],[341,340],[342,341],[343,342],[344,343],[345,344],[346,345],[347,346],[348,347],[349,348],[350,349],[351,350],[352,351],[353,352],[354,353],[355,354],[356,355],[357,356],[358,357],[359,358],[360,359],[361,360],[362,361],[363,362],[364,363],[365,364],[366,365],[367,366],[368,367],[369,368],[370,369],[371,370],[372,371],[373,372],[374,373],[375,374],[376,375],[377,376],[378,377],[379,378],[380,379],[381,380],[382,381],[383,382],[384,383],[385,384],[386,385],[387,386],[388,387],[389,388],[390,389],[391,390],[392,391],[393,392],[394,393],[395,394],[396,395],[397,396],[398,397],[399,398],[400,399],[401,400],[402,401],[403,402],[404,403],[405,404],[406,405],[407,406],[408,407],[409,408],[410,409],[411,410],[412,411],[413,412],[414,413],[415,414],[416,415],[417,416],[418,417],[419,418],[420,419],[421,420],[422,421],[423,422],[424,423],[425,424],[426,425],[427,426],[428,427],[429,428],[430,429],[431,430],[432,431],[433,432],[434,433],[435,434],[436,435],[437,436],[438,437],[439,438],[440,439],[441,440],[442,441],[443,442],[444,443],[445,444],[446,445],[447,446],[448,447],[449,448],[450,449],[451,450],[452,451],[453,452],[454,453],[455,454],[456,455],[457,456],[458,457],[459,458],[460,459],[461,460],[462,461],[463,462],[464,463],[465,464],[466,465],[467,466],[468,467],[469,468],[470,469],[471,470],[472,471],[473,472],[474,473],[475,474],[476,475],[477,476],[478,477],[479,478],[480,479],[481,480],[482,481],[483,482],[484,483],[485,484],[486,485],[487,486],[488,487],[489,488],[490,489],[491,490],[492,491],[493,492],[494,493],[495,494],[496,495],[497,496],[498,497],[499,498],[500,499],[501,500],[502,501],[503,502],[504,503],[505,504],[506,505],[507,506],[508,507],[509,508],[510,509],[511,510],[512,511],[513,512],[514,513],[515,514],[516,515],[517,516],[518,517],[519,518],[520,519],[521,520],[522,521],[523,522],[524,523],[525,524],[526,525],[527,526],[528,527],[529,528],[530,529],[531,530],[532,531],[533,532],[534,533],[535,534],[536,535],[537,536],[538,537],[539,538],[540,539],[541,540],[542,541],[543,542],[544,543],[545,544],[546,545],[547,546],[548,547],[549,548],[550,549],[551,550],[552,551],[553,552],[554,553],[555,554],[556,555],[557,556],[558,557],[559,558],[560,559],[561,560],[562,561],[563,562],[564,563],[565,564],[566,565],[567,566],[568,567],[569,568],[570,569],[571,570],[572,571],[573,572],[574,573],[575,574],[576,575],[577,576],[578,577],[579,578],[580,579],[581,580],[582,581],[583,582],[584,583],[585,584],[586,585],[587,586],[588,587],[589,588],[590,589],[591,590],[592,591],[593,592],[594,593],[595,594],[596,595],[597,596],[598,597],[599,598],[600,599],[601,600],[602,601],[603,602],[604,603],[605,604],[606,605],[607,606],[608,607],[609,608],[610,609],[611,610],[612,611],[613,612],[614,613],[615,614],[616,615],[617,616],[618,617],[619,618],[620,619],[621,620],[622,621],[623,622],[624,623],[625,624],[626,625],[627,626],[628,627],[629,628],[630,629],[631,630],[632,631],[633,632],[634,633],[635,634],[636,635],[637,636],[638,637],[639,638],[640,639],[641,640],[642,641],[643,642],[644,643],[645,644],[646,645],[647,646],[648,647],[649,648],[650,649],[651,650],[652,651],[653,652],[654,653],[655,654],[656,655],[657,656],[658,657],[659,658],[660,659],[661,660],[662,661],[663,662],[664,663],[665,664],[666,665],[667,666],[668,667],[669,668],[670,669],[671,670],[672,671],[673,672],[674,673],[675,674],[676,675],[677,676],[678,677],[679,678],[680,679],[681,680],[682,681],[683,682],[684,683],[685,684],[686,685],[687,686],[688,687],[689,688],[690,689],[691,690],[692,691],[693,692],[694,693],[695,694],[696,695],[697,696],[698,697],[699,698],[700,699],[701,700],[702,701],[703,702],[704,703],[705,704],[706,705],[707,706],[708,707],[709,708],[710,709],[711,710],[712,711],[713,712],[714,713],[715,714],[716,715],[717,716],[718,717],[719,718],[720,719],[721,720],[722,721],[723,722],[724,723],[725,724],[726,725],[727,726],[728,727],[729,728],[730,729],[731,730],[732,731],[733,732],[734,733],[735,734],[736,735],[737,736],[738,737],[739,738],[740,739],[741,740],[742,741],[743,742],[744,743],[745,744],[746,745],[747,746],[748,747],[749,748],[750,749],[751,750],[752,751],[753,752],[754,753],[755,754],[756,755],[757,756],[758,757],[759,758],[760,759],[761,760],[762,761],[763,762],[764,763],[765,764],[766,765],[767,766],[768,767],[769,768],[770,769],[771,770],[772,771],[773,772],[774,773],[775,774],[776,775],[777,776],[778,777],[779,778],[780,779],[781,780],[782,781],[783,782],[784,783],[785,784],[786,785],[787,786],[788,787],[789,788],[790,789],[791,790],[792,791],[793,792],[794,793],[795,794],[796,795],[797,796],[798,797],[799,798],[800,799],[801,800],[802,801],[803,802],[804,803],[805,804],[806,805],[807,806],[808,807],[809,808],[810,809],[811,810],[812,811],[813,812],[814,813],[815,814],[816,815],[817,816],[818,817],[819,818],[820,819],[821,820],[822,821],[823,822],[824,823],[825,824],[826,825],[827,826],[828,827],[829,828],[830,829],[831,830],[832,831],[833,832],[834,833],[835,834],[836,835],[837,836],[838,837],[839,838],[840,839],[841,840],[842,841],[843,842],[844,843],[845,844],[846,845],[847,846],[848,847],[849,848],[850,849],[851,850],[852,851],[853,852],[854,853],[855,854],[856,855],[857,856],[858,857],[859,858],[860,859],[861,860],[862,861],[863,862],[864,863],[865,864],[866,865],[867,866],[868,867],[869,868],[870,869],[871,870],[872,871],[873,872],[874,873],[875,874],[876,875],[877,876],[878,877],[879,878],[880,879],[881,880],[882,881],[883,882],[884,883],[885,884],[886,885],[887,886],[888,887],[889,888],[890,889],[891,890],[892,891],[893,892],[894,893],[895,894],[896,895],[897,896],[898,897],[899,898],[900,899],[901,900],[902,901],[903,902],[904,903],[905,904],[906,905],[907,906],[908,907],[909,908],[910,909],[911,910],[912,911],[913,912],[914,913],[915,914],[916,915],[917,916],[918,917],[919,918],[920,919],[921,920],[922,921],[923,922],[924,923],[925,924],[926,925],[927,926],[928,927],[929,928],[930,929],[931,930],[932,931],[933,932],[934,933],[935,934],[936,935],[937,936],[938,937],[939,938],[940,939],[941,940],[942,941],[943,942],[944,943],[945,944],[946,945],[947,946],[948,947],[949,948],[950,949],[951,950],[952,951],[953,952],[954,953],[955,954],[956,955],[957,956],[958,957],[959,958],[960,959],[961,960],[962,961],[963,962],[964,963],[965,964],[966,965],[967,966],[968,967],[969,968],[970,969],[971,970],[972,971],[973,972],[974,973],[975,974],[976,975],[977,976],[978,977],[979,978],[980,979],[981,980],[982,981],[983,982],[984,983],[985,984],[986,985],[987,986],[988,987],[989,988],[990,989],[991,990],[992,991],[993,992],[994,993],[995,994],[996,995],[997,996],[998,997],[999,998],[1000,999],[1001,1000],[1002,1001],[1003,1002],[1004,1003],[1005,1004],[1006,1005],[1007,1006],[1008,1007],[1009,1008],[1010,1009],[1011,1010],[1012,1011],[1013,1012],[1014,1013],[1015,1014],[1016,1015],[1017,1016],[1018,1017],[1019,1018],[1020,1019],[1021,1020],[1022,1021],[1023,1022],[1024,1023],[1025,1024],[1026,1025],[1027,1026],[1028,1027],[1029,1028],[1030,1029],[1031,1030],[1032,1031],[1033,1032],[1034,1033],[1035,1034],[1036,1035],[1037,1036],[1038,1037],[1039,1038],[1040,1039],[1041,1040],[1042,1041],[1043,1042],[1044,1043],[1045,1044],[1046,1045],[1047,1046],[1048,1047],[1049,1048],[1050,1049],[1051,1050],[1052,1051],[1053,1052],[1054,1053],[1055,1054],[1056,1055],[1057,1056],[1058,1057],[1059,1058],[1060,1059],[1061,1060],[1062,1061],[1063,1062],[1064,1063],[1065,1064],[1066,1065],[1067,1066],[1068,1067],[1069,1068],[1070,1069],[1071,1070],[1072,1071],[1073,1072],[1074,1073],[1075,1074],[1076,1075],[1077,1076],[1078,1077],[1079,1078],[1080,1079],[1081,1080],[1082,1081],[1083,1082],[1084,1083],[1085,1084],[1086,1085],[1087,1086],[1088,1087],[1089,1088],[1090,1089],[1091,1090],[1092,1091],[1093,1092],[1094,1093],[1095,1094],[1096,1095],[1097,1096],[1098,1097],[1099,1098],[1100,1099],[1101,1100],[1102,1101],[1103,1102],[1104,1103],[1105,1104],[1106,1105],[1107,1106],[1108,1107],[1109,1108],[1110,1109],[1111,1110],[1112,1111],[1113,1112],[1114,1113],[1115,1114],[1116,1115],[1117,1116],[1118,1117],[1119,1118],[1120,1119],[1121,1120],[1122,1121],[1123,1122],[1124,1123],[1125,1124],[1126,1125],[1127,1126],[1128,1127],[1129,1128],[1130,1129],[1131,1130],[1132,1131],[1133,1132],[1134,1133],[1135,1134],[1136,1135],[1137,1136],[1138,1137],[1139,1138],[1140,1139],[1141,1140],[1142,1141],[1143,1142],[1144,1143],[1145,1144],[1146,1145],[1147,1146],[1148,1147],[1149,1148],[1150,1149],[1151,1150],[1152,1151],[1153,1152],[1154,1153],[1155,1154],[1156,1155],[1157,1156],[1158,1157],[1159,1158],[1160,1159],[1161,1160],[1162,1161],[1163,1162],[1164,1163],[1165,1164],[1166,1165],[1167,1166],[1168,1167],[1169,1168],[1170,1169],[1171,1170],[1172,1171],[1173,1172],[1174,1173],[1175,1174],[1176,1175],[1177,1176],[1178,1177],[1179,1178],[1180,1179],[1181,1180],[1182,1181],[1183,1182],[1184,1183],[1185,1184],[1186,1185],[1187,1186],[1188,1187],[1189,1188],[1190,1189],[1191,1190],[1192,1191],[1193,1192],[1194,1193],[1195,1194],[1196,1195],[1197,1196],[1198,1197],[1199,1198],[1200,1199],[1201,1200],[1202,1201],[1203,1202],[1204,1203],[1205,1204],[1206,1205],[1207,1206],[1208,1207],[1209,1208],[1210,1209],[1211,1210],[1212,1211],[1213,1212],[1214,1213],[1215,1214],[1216,1215],[1217,1216],[1218,1217],[1219,1218],[1220,1219],[1221,1220],[1222,1221],[1223,1222],[1224,1223],[1225,1224],[1226,1225],[1227,1226],[1228,1227],[1229,1228],[1230,1229],[1231,1230],[1232,1231],[1233,1232],[1234,1233],[1235,1234],[1236,1235],[1237,1236],[1238,1237],[1239,1238],[1240,1239],[1241,1240],[1242,1241],[1243,1242],[1244,1243],[1245,1244],[1246,1245],[1247,1246],[1248,1247],[1249,1248],[1250,1249],[1251,1250],[1252,1251],[1253,1252],[1254,1253],[1255,1254],[1256,1255],[1257,1256],[1258,1257],[1259,1258],[1260,1259],[1261,1260],[1262,1261],[1263,1262],[1264,1263],[1265,1264],[1266,1265],[1267,1266],[1268,1267],[1269,1268],[1270,1269],[1271,1270],[1272,1271],[1273,1272],[1274,1273],[1275,1274],[1276,1275],[1277,1276],[1278,1277],[1279,1278],[1280,1279],[1281,1280],[1282,1281],[1283,1282],[1284,1283],[1285,1284],[1286,1285],[1287,1286],[1288,1287],[1289,1288],[1290,1289],[1291,1290],[1292,1291],[1293,1292],[1294,1293],[1295,1294],[1296,1295],[1297,1296],[1298,1297],[1299,1298],[1300,1299],[1301,1300],[1302,1301],[1303,1302],[1304,1303],[1305,1304],[1306,1305],[1307,1306],[1308,1307],[1309,1308],[1310,1309],[1311,1310],[1312,1311],[1313,1312],[1314,1313],[1315,1314],[1316,1315],[1317,1316],[1318,1317],[1319,1318],[1320,1319],[1321,1320],[1322,1321],[1323,1322],[1324,1323],[1325,1324],[1326,1325],[1327,1326],[1328,1327],[1329,1328],[1330,1329],[1331,1330],[1332,1331],[1333,1332],[1334,1333],[1335,1334],[1336,1335],[1337,1336],[1338,1337],[1339,1338],[1340,1339],[1341,1340],[1342,1341],[1343,1342],[1344,1343],[1345,1344],[1346,1345],[1347,1346],[1348,1347],[1349,1348],[1350,1349],[1351,1350],[1352,1351],[1353,1352],[1354,1353],[1355,1354],[1356,1355],[1357,1356],[1358,1357],[1359,1358],[1360,1359],[1361,1360],[1362,1361],[1363,1362],[1364,1363],[1365,1364],[1366,1365],[1367,1366],[1368,1367],[1369,1368],[1370,1369],[1371,1370],[1372,1371],[1373,1372],[1374,1373],[1375,1374],[1376,1375],[1377,1376],[1378,1377],[1379,1378],[1380,1379],[1381,1380],[1382,1381],[1383,1382],[1384,1383],[1385,1384],[1386,1385],[1387,1386],[1388,1387],[1389,1388],[1390,1389],[1391,1390],[1392,1391],[1393,1392],[1394,1393],[1395,1394],[1396,1395],[1397,1396],[1398,1397],[1399,1398],[1400,1399],[1401,1400],[1402,1401],[1403,1402],[1404,1403],[1405,1404],[1406,1405],[1407,1406],[1408,1407],[1409,1408],[1410,1409],[1411,1410],[1412,1411],[1413,1412],[1414,1413],[1415,1414],[1416,1415],[1417,1416],[1418,1417],[1419,1418],[1420,1419],[1421,1420],[1422,1421],[1423,1422],[1424,1423],[1425,1424],[1426,1425],[1427,1426],[1428,1427],[1429,1428],[1430,1429],[1431,1430],[1432,1431],[1433,1432],[1434,1433],[1435,1434],[1436,1435],[1437,1436],[1438,1437],[1439,1438],[1440,1439],[1441,1440],[1442,1441],[1443,1442],[1444,1443],[1445,1444],[1446,1445],[1447,1446],[1448,1447],[1449,1448],[1450,1449],[1451,1450],[1452,1451],[1453,1452],[1454,1453],[1455,1454],[1456,1455],[1457,1456],[1458,1457],[1459,1458],[1460,1459],[1461,1460],[1462,1461],[1463,1462],[1464,1463],[1465,1464],[1466,1465],[1467,1466],[1468,1467],[1469,1468],[1470,1469],[1471,1470],[1472,1471],[1473,1472],[1474,1473],[1475,1474],[1476,1475],[1477,1476],[1478,1477],[1479,1478],[1480,1479],[1481,1480],[1482,1481],[1483,1482],[1484,1483],[1485,1484],[1486,1485],[1487,1486],[1488,1487],[1489,1488],[1490,1489],[1491,1490],[1492,1491],[1493,1492],[1494,1493],[1495,1494],[1496,1495],[1497,1496],[1498,1497],[1499,1498],[1500,1499],[1501,1500],[1502,1501],[1503,1502],[1504,1503],[1505,1504],[1506,1505],[1507,1506],[1508,1507],[1509,1508],[1510,1509],[1511,1510],[1512,1511],[1513,1512],[1514,1513],[1515,1514],[1516,1515],[1517,1516],[1518,1517],[1519,1518],[1520,1519],[1521,1520],[1522,1521],[1523,1522],[1524,1523],[1525,1524],[1526,1525],[1527,1526],[1528,1527],[1529,1528],[1530,1529],[1531,1530],[1532,1531],[1533,1532],[1534,1533],[1535,1534],[1536,1535],[1537,1536],[1538,1537],[1539,1538],[1540,1539],[1541,1540],[1542,1541],[1543,1542],[1544,1543],[1545,1544],[1546,1545],[1547,1546],[1548,1547],[1549,1548],[1550,1549],[1551,1550],[1552,1551],[1553,1552],[1554,1553],[1555,1554],[1556,1555],[1557,1556],[1558,1557],[1559,1558],[1560,1559],[1561,1560],[1562,1561],[1563,1562],[1564,1563],[1565,1564],[1566,1565],[1567,1566],[1568,1567],[1569,1568],[1570,1569],[1571,1570],[1572,1571],[1573,1572],[1574,1573],[1575,1574],[1576,1575],[1577,1576],[1578,1577],[1579,1578],[1580,1579],[1581,1580],[1582,1581],[1583,1582],[1584,1583],[1585,1584],[1586,1585],[1587,1586],[1588,1587],[1589,1588],[1590,1589],[1591,1590],[1592,1591],[1593,1592],[1594,1593],[1595,1594],[1596,1595],[1597,1596],[1598,1597],[1599,1598],[1600,1599],[1601,1600],[1602,1601],[1603,1602],[1604,1603],[1605,1604],[1606,1605],[1607,1606],[1608,1607],[1609,1608],[1610,1609],[1611,1610],[1612,1611],[1613,1612],[1614,1613],[1615,1614],[1616,1615],[1617,1616],[1618,1617],[1619,1618],[1620,1619],[1621,1620],[1622,1621],[1623,1622],[1624,1623],[1625,1624],[1626,1625],[1627,1626],[1628,1627],[1629,1628],[1630,1629],[1631,1630],[1632,1631],[1633,1632],[1634,1633],[1635,1634],[1636,1635],[1637,1636],[1638,1637],[1639,1638],[1640,1639],[1641,1640],[1642,1641],[1643,1642],[1644,1643],[1645,1644],[1646,1645],[1647,1646],[1648,1647],[1649,1648],[1650,1649],[1651,1650],[1652,1651],[1653,1652],[1654,1653],[1655,1654],[1656,1655],[1657,1656],[1658,1657],[1659,1658],[1660,1659],[1661,1660],[1662,1661],[1663,1662],[1664,1663],[1665,1664],[1666,1665],[1667,1666],[1668,1667],[1669,1668],[1670,1669],[1671,1670],[1672,1671],[1673,1672],[1674,1673],[1675,1674],[1676,1675],[1677,1676],[1678,1677],[1679,1678],[1680,1679],[1681,1680],[1682,1681],[1683,1682],[1684,1683],[1685,1684],[1686,1685],[1687,1686],[1688,1687],[1689,1688],[1690,1689],[1691,1690],[1692,1691],[1693,1692],[1694,1693],[1695,1694],[1696,1695],[1697,1696],[1698,1697],[1699,1698],[1700,1699],[1701,1700],[1702,1701],[1703,1702],[1704,1703],[1705,1704],[1706,1705],[1707,1706],[1708,1707],[1709,1708],[1710,1709],[1711,1710],[1712,1711],[1713,1712],[1714,1713],[1715,1714],[1716,1715],[1717,1716],[1718,1717],[1719,1718],[1720,1719],[1721,1720],[1722,1721],[1723,1722],[1724,1723],[1725,1724],[1726,1725],[1727,1726],[1728,1727],[1729,1728],[1730,1729],[1731,1730],[1732,1731],[1733,1732],[1734,1733],[1735,1734],[1736,1735],[1737,1736],[1738,1737],[1739,1738],[1740,1739],[1741,1740],[1742,1741],[1743,1742],[1744,1743],[1745,1744],[1746,1745],[1747,1746],[1748,1747],[1749,1748],[1750,1749],[1751,1750],[1752,1751],[1753,1752],[1754,1753],[1755,1754],[1756,1755],[1757,1756],[1758,1757],[1759,1758],[1760,1759],[1761,1760],[1762,1761],[1763,1762],[1764,1763],[1765,1764],[1766,1765],[1767,1766],[1768,1767],[1769,1768],[1770,1769],[1771,1770],[1772,1771],[1773,1772],[1774,1773],[1775,1774],[1776,1775],[1777,1776],[1778,1777],[1779,1778],[1780,1779],[1781,1780],[1782,1781],[1783,1782],[1784,1783],[1785,1784],[1786,1785],[1787,1786],[1788,1787],[1789,1788],[1790,1789],[1791,1790],[1792,1791],[1793,1792],[1794,1793],[1795,1794],[1796,1795],[1797,1796],[1798,1797],[1799,1798],[1800,1799],[1801,1800],[1802,1801],[1803,1802],[1804,1803],[1805,1804],[1806,1805],[1807,1806],[1808,1807],[1809,1808],[1810,1809],[1811,1810],[1812,1811],[1813,1812],[1814,1813],[1815,1814],[1816,1815],[1817,1816],[1818,1817],[1819,1818],[1820,1819],[1821,1820],[1822,1821],[1823,1822],[1824,1823],[1825,1824],[1826,1825],[1827,1826],[1828,1827],[1829,1828],[1830,1829],[1831,1830],[1832,1831],[1833,1832],[1834,1833],[1835,1834],[1836,1835],[1837,1836],[1838,1837],[1839,1838],[1840,1839],[1841,1840],[1842,1841],[1843,1842],[1844,1843],[1845,1844],[1846,1845],[1847,1846],[1848,1847],[1849,1848],[1850,1849],[1851,1850],[1852,1851],[1853,1852],[1854,1853],[1855,1854],[1856,1855],[1857,1856],[1858,1857],[1859,1858],[1860,1859],[1861,1860],[1862,1861],[1863,1862],[1864,1863],[1865,1864],[1866,1865],[1867,1866],[1868,1867],[1869,1868],[1870,1869],[1871,1870],[1872,1871],[1873,1872],[1874,1873],[1875,1874],[1876,1875],[1877,1876],[1878,1877],[1879,1878],[1880,1879],[1881,1880],[1882,1881],[1883,1882],[1884,1883],[1885,1884],[1886,1885],[1887,1886],[1888,1887],[1889,1888],[1890,1889],[1891,1890],[1892,1891],[1893,1892],[1894,1893],[1895,1894],[1896,1895],[1897,1896],[1898,1897],[1899,1898],[1900,1899],[1901,1900],[1902,1901],[1903,1902],[1904,1903],[1905,1904],[1906,1905],[1907,1906],[1908,1907],[1909,1908],[1910,1909],[1911,1910],[1912,1911],[1913,1912],[1914,1913],[1915,1914],[1916,1915],[1917,1916],[1918,1917],[1919,1918],[1920,1919],[1921,1920],[1922,1921],[1923,1922],[1924,1923],[1925,1924],[1926,1925],[1927,1926],[1928,1927],[1929,1928],[1930,1929],[1931,1930],[1932,1931],[1933,1932],[1934,1933],[1935,1934],[1936,1935],[1937,1936],[1938,1937],[1939,1938],[1940,1939],[1941,1940],[1942,1941],[1943,1942],[1944,1943],[1945,1944],[1946,1945],[1947,1946],[1948,1947],[1949,1948],[1950,1949],[1951,1950],[1952,1951],[1953,1952],[1954,1953],[1955,1954],[1956,1955],[1957,1956],[1958,1957],[1959,1958],[1960,1959],[1961,1960],[1962,1961],[1963,1962],[1964,1963],[1965,1964],[1966,1965],[1967,1966],[1968,1967],[1969,1968],[1970,1969],[1971,1970],[1972,1971],[1973,1972],[1974,1973],[1975,1974],[1976,1975],[1977,1976],[1978,1977],[1979,1978],[1980,1979],[1981,1980],[1982,1981],[1983,1982],[1984,1983],[1985,1984],[1986,1985],[1987,1986],[1988,1987],[1989,1988],[1990,1989],[1991,1990],[1992,1991],[1993,1992],[1994,1993],[1995,1994],[1996,1995],[1997,1996],[1998,1997],[1999,1998],[2,0],[3,1],[4,2],[5,3],[6,4],[7,5],[8,6],[9,7],[10,8],[11,9],[12,10],[13,11],[14,12],[15,13],[16,14],[17,15],[18,16],[19,17],[20,18],[21,19],[22,20],[23,21],[24,22],[25,23],[26,24],[27,25],[28,26],[29,27],[30,28],[31,29],[32,30],[33,31],[34,32],[35,33],[36,34],[37,35],[38,36],[39,37],[40,38],[41,39],[42,40],[43,41],[44,42],[45,43],[46,44],[47,45],[48,46],[49,47],[50,48],[51,49],[52,50],[53,51],[54,52],[55,53],[56,54],[57,55],[58,56],[59,57],[60,58],[61,59],[62,60],[63,61],[64,62],[65,63],[66,64],[67,65],[68,66],[69,67],[70,68],[71,69],[72,70],[73,71],[74,72],[75,73],[76,74],[77,75],[78,76],[79,77],[80,78],[81,79],[82,80],[83,81],[84,82],[85,83],[86,84],[87,85],[88,86],[89,87],[90,88],[91,89],[92,90],[93,91],[94,92],[95,93],[96,94],[97,95],[98,96],[99,97],[100,98],[101,99],[102,100],[103,101],[104,102],[105,103],[106,104],[107,105],[108,106],[109,107],[110,108],[111,109],[112,110],[113,111],[114,112],[115,113],[116,114],[117,115],[118,116],[119,117],[120,118],[121,119],[122,120],[123,121],[124,122],[125,123],[126,124],[127,125],[128,126],[129,127],[130,128],[131,129],[132,130],[133,131],[134,132],[135,133],[136,134],[137,135],[138,136],[139,137],[140,138],[141,139],[142,140],[143,141],[144,142],[145,143],[146,144],[147,145],[148,146],[149,147],[150,148],[151,149],[152,150],[153,151],[154,152],[155,153],[156,154],[157,155],[158,156],[159,157],[160,158],[161,159],[162,160],[163,161],[164,162],[165,163],[166,164],[167,165],[168,166],[169,167],[170,168],[171,169],[172,170],[173,171],[174,172],[175,173],[176,174],[177,175],[178,176],[179,177],[180,178],[181,179],[182,180],[183,181],[184,182],[185,183],[186,184],[187,185],[188,186],[189,187],[190,188],[191,189],[192,190],[193,191],[194,192],[195,193],[196,194],[197,195],[198,196],[199,197],[200,198],[201,199],[202,200],[203,201],[204,202],[205,203],[206,204],[207,205],[208,206],[209,207],[210,208],[211,209],[212,210],[213,211],[214,212],[215,213],[216,214],[217,215],[218,216],[219,217],[220,218],[221,219],[222,220],[223,221],[224,222],[225,223],[226,224],[227,225],[228,226],[229,227],[230,228],[231,229],[232,230],[233,231],[234,232],[235,233],[236,234],[237,235],[238,236],[239,237],[240,238],[241,239],[242,240],[243,241],[244,242],[245,243],[246,244],[247,245],[248,246],[249,247],[250,248],[251,249],[252,250],[253,251],[254,252],[255,253],[256,254],[257,255],[258,256],[259,257],[260,258],[261,259],[262,260],[263,261],[264,262],[265,263],[266,264],[267,265],[268,266],[269,267],[270,268],[271,269],[272,270],[273,271],[274,272],[275,273],[276,274],[277,275],[278,276],[279,277],[280,278],[281,279],[282,280],[283,281],[284,282],[285,283],[286,284],[287,285],[288,286],[289,287],[290,288],[291,289],[292,290],[293,291],[294,292],[295,293],[296,294],[297,295],[298,296],[299,297],[300,298],[301,299],[302,300],[303,301],[304,302],[305,303],[306,304],[307,305],[308,306],[309,307],[310,308],[311,309],[312,310],[313,311],[314,312],[315,313],[316,314],[317,315],[318,316],[319,317],[320,318],[321,319],[322,320],[323,321],[324,322],[325,323],[326,324],[327,325],[328,326],[329,327],[330,328],[331,329],[332,330],[333,331],[334,332],[335,333],[336,334],[337,335],[338,336],[339,337],[340,338],[341,339],[342,340],[343,341],[344,342],[345,343],[346,344],[347,345],[348,346],[349,347],[350,348],[351,349],[352,350],[353,351],[354,352],[355,353],[356,354],[357,355],[358,356],[359,357],[360,358],[361,359],[362,360],[363,361],[364,362],[365,363],[366,364],[367,365],[368,366],[369,367],[370,368],[371,369],[372,370],[373,371],[374,372],[375,373],[376,374],[377,375],[378,376],[379,377],[380,378],[381,379],[382,380],[383,381],[384,382],[385,383],[386,384],[387,385],[388,386],[389,387],[390,388],[391,389],[392,390],[393,391],[394,392],[395,393],[396,394],[397,395],[398,396],[399,397],[400,398],[401,399],[402,400],[403,401],[404,402],[405,403],[406,404],[407,405],[408,406],[409,407],[410,408],[411,409],[412,410],[413,411],[414,412],[415,413],[416,414],[417,415],[418,416],[419,417],[420,418],[421,419],[422,420],[423,421],[424,422],[425,423],[426,424],[427,425],[428,426],[429,427],[430,428],[431,429],[432,430],[433,431],[434,432],[435,433],[436,434],[437,435],[438,436],[439,437],[440,438],[441,439],[442,440],[443,441],[444,442],[445,443],[446,444],[447,445],[448,446],[449,447],[450,448],[451,449],[452,450],[453,451],[454,452],[455,453],[456,454],[457,455],[458,456],[459,457],[460,458],[461,459],[462,460],[463,461],[464,462],[465,463],[466,464],[467,465],[468,466],[469,467],[470,468],[471,469],[472,470],[473,471],[474,472],[475,473],[476,474],[477,475],[478,476],[479,477],[480,478],[481,479],[482,480],[483,481],[484,482],[485,483],[486,484],[487,485],[488,486],[489,487],[490,488],[491,489],[492,490],[493,491],[494,492],[495,493],[496,494],[497,495],[498,496],[499,497],[500,498],[501,499],[502,500],[503,501],[504,502],[505,503],[506,504],[507,505],[508,506],[509,507],[510,508],[511,509],[512,510],[513,511],[514,512],[515,513],[516,514],[517,515],[518,516],[519,517],[520,518],[521,519],[522,520],[523,521],[524,522],[525,523],[526,524],[527,525],[528,526],[529,527],[530,528],[531,529],[532,530],[533,531],[534,532],[535,533],[536,534],[537,535],[538,536],[539,537],[540,538],[541,539],[542,540],[543,541],[544,542],[545,543],[546,544],[547,545],[548,546],[549,547],[550,548],[551,549],[552,550],[553,551],[554,552],[555,553],[556,554],[557,555],[558,556],[559,557],[560,558],[561,559],[562,560],[563,561],[564,562],[565,563],[566,564],[567,565],[568,566],[569,567],[570,568],[571,569],[572,570],[573,571],[574,572],[575,573],[576,574],[577,575],[578,576],[579,577],[580,578],[581,579],[582,580],[583,581],[584,582],[585,583],[586,584],[587,585],[588,586],[589,587],[590,588],[591,589],[592,590],[593,591],[594,592],[595,593],[596,594],[597,595],[598,596],[599,597],[600,598],[601,599],[602,600],[603,601],[604,602],[605,603],[606,604],[607,605],[608,606],[609,607],[610,608],[611,609],[612,610],[613,611],[614,612],[615,613],[616,614],[617,615],[618,616],[619,617],[620,618],[621,619],[622,620],[623,621],[624,622],[625,623],[626,624],[627,625],[628,626],[629,627],[630,628],[631,629],[632,630],[633,631],[634,632],[635,633],[636,634],[637,635],[638,636],[639,637],[640,638],[641,639],[642,640],[643,641],[644,642],[645,643],[646,644],[647,645],[648,646],[649,647],[650,648],[651,649],[652,650],[653,651],[654,652],[655,653],[656,654],[657,655],[658,656],[659,657],[660,658],[661,659],[662,660],[663,661],[664,662],[665,663],[666,664],[667,665],[668,666],[669,667],[670,668],[671,669],[672,670],[673,671],[674,672],[675,673],[676,674],[677,675],[678,676],[679,677],[680,678],[681,679],[682,680],[683,681],[684,682],[685,683],[686,684],[687,685],[688,686],[689,687],[690,688],[691,689],[692,690],[693,691],[694,692],[695,693],[696,694],[697,695],[698,696],[699,697],[700,698],[701,699],[702,700],[703,701],[704,702],[705,703],[706,704],[707,705],[708,706],[709,707],[710,708],[711,709],[712,710],[713,711],[714,712],[715,713],[716,714],[717,715],[718,716],[719,717],[720,718],[721,719],[722,720],[723,721],[724,722],[725,723],[726,724],[727,725],[728,726],[729,727],[730,728],[731,729],[732,730],[733,731],[734,732],[735,733],[736,734],[737,735],[738,736],[739,737],[740,738],[741,739],[742,740],[743,741],[744,742],[745,743],[746,744],[747,745],[748,746],[749,747],[750,748],[751,749],[752,750],[753,751],[754,752],[755,753],[756,754],[757,755],[758,756],[759,757],[760,758],[761,759],[762,760],[763,761],[764,762],[765,763],[766,764],[767,765],[768,766],[769,767],[770,768],[771,769],[772,770],[773,771],[774,772],[775,773],[776,774],[777,775],[778,776],[779,777],[780,778],[781,779],[782,780],[783,781],[784,782],[785,783],[786,784],[787,785],[788,786],[789,787],[790,788],[791,789],[792,790],[793,791],[794,792],[795,793],[796,794],[797,795],[798,796],[799,797],[800,798],[801,799],[802,800],[803,801],[804,802],[805,803],[806,804],[807,805],[808,806],[809,807],[810,808],[811,809],[812,810],[813,811],[814,812],[815,813],[816,814],[817,815],[818,816],[819,817],[820,818],[821,819],[822,820],[823,821],[824,822],[825,823],[826,824],[827,825],[828,826],[829,827],[830,828],[831,829],[832,830],[833,831],[834,832],[835,833],[836,834],[837,835],[838,836],[839,837],[840,838],[841,839],[842,840],[843,841],[844,842],[845,843],[846,844],[847,845],[848,846],[849,847],[850,848],[851,849],[852,850],[853,851],[854,852],[855,853],[856,854],[857,855],[858,856],[859,857],[860,858],[861,859],[862,860],[863,861],[864,862],[865,863],[866,864],[867,865],[868,866],[869,867],[870,868],[871,869],[872,870],[873,871],[874,872],[875,873],[876,874],[877,875],[878,876],[879,877],[880,878],[881,879],[882,880],[883,881],[884,882],[885,883],[886,884],[887,885],[888,886],[889,887],[890,888],[891,889],[892,890],[893,891],[894,892],[895,893],[896,894],[897,895],[898,896],[899,897],[900,898],[901,899],[902,900],[903,901],[904,902],[905,903],[906,904],[907,905],[908,906],[909,907],[910,908],[911,909],[912,910],[913,911],[914,912],[915,913],[916,914],[917,915],[918,916],[919,917],[920,918],[921,919],[922,920],[923,921],[924,922],[925,923],[926,924],[927,925],[928,926],[929,927],[930,928],[931,929],[932,930],[933,931],[934,932],[935,933],[936,934],[937,935],[938,936],[939,937],[940,938],[941,939],[942,940],[943,941],[944,942],[945,943],[946,944],[947,945],[948,946],[949,947],[950,948],[951,949],[952,950],[953,951],[954,952],[955,953],[956,954],[957,955],[958,956],[959,957],[960,958],[961,959],[962,960],[963,961],[964,962],[965,963],[966,964],[967,965],[968,966],[969,967],[970,968],[971,969],[972,970],[973,971],[974,972],[975,973],[976,974],[977,975],[978,976],[979,977],[980,978],[981,979],[982,980],[983,981],[984,982],[985,983],[986,984],[987,985],[988,986],[989,987],[990,988],[991,989],[992,990],[993,991],[994,992],[995,993],[996,994],[997,995],[998,996],[999,997],[1000,998],[1001,999],[1002,1000],[1003,1001],[1004,1002],[1005,1003],[1006,1004],[1007,1005],[1008,1006],[1009,1007],[1010,1008],[1011,1009],[1012,1010],[1013,1011],[1014,1012],[1015,1013],[1016,1014],[1017,1015],[1018,1016],[1019,1017],[1020,1018],[1021,1019],[1022,1020],[1023,1021],[1024,1022],[1025,1023],[1026,1024],[1027,1025],[1028,1026],[1029,1027],[1030,1028],[1031,1029],[1032,1030],[1033,1031],[1034,1032],[1035,1033],[1036,1034],[1037,1035],[1038,1036],[1039,1037],[1040,1038],[1041,1039],[1042,1040],[1043,1041],[1044,1042],[1045,1043],[1046,1044],[1047,1045],[1048,1046],[1049,1047],[1050,1048],[1051,1049],[1052,1050],[1053,1051],[1054,1052],[1055,1053],[1056,1054],[1057,1055],[1058,1056],[1059,1057],[1060,1058],[1061,1059],[1062,1060],[1063,1061],[1064,1062],[1065,1063],[1066,1064],[1067,1065],[1068,1066],[1069,1067],[1070,1068],[1071,1069],[1072,1070],[1073,1071],[1074,1072],[1075,1073],[1076,1074],[1077,1075],[1078,1076],[1079,1077],[1080,1078],[1081,1079],[1082,1080],[1083,1081],[1084,1082],[1085,1083],[1086,1084],[1087,1085],[1088,1086],[1089,1087],[1090,1088],[1091,1089],[1092,1090],[1093,1091],[1094,1092],[1095,1093],[1096,1094],[1097,1095],[1098,1096],[1099,1097],[1100,1098],[1101,1099],[1102,1100],[1103,1101],[1104,1102],[1105,1103],[1106,1104],[1107,1105],[1108,1106],[1109,1107],[1110,1108],[1111,1109],[1112,1110],[1113,1111],[1114,1112],[1115,1113],[1116,1114],[1117,1115],[1118,1116],[1119,1117],[1120,1118],[1121,1119],[1122,1120],[1123,1121],[1124,1122],[1125,1123],[1126,1124],[1127,1125],[1128,1126],[1129,1127],[1130,1128],[1131,1129],[1132,1130],[1133,1131],[1134,1132],[1135,1133],[1136,1134],[1137,1135],[1138,1136],[1139,1137],[1140,1138],[1141,1139],[1142,1140],[1143,1141],[1144,1142],[1145,1143],[1146,1144],[1147,1145],[1148,1146],[1149,1147],[1150,1148],[1151,1149],[1152,1150],[1153,1151],[1154,1152],[1155,1153],[1156,1154],[1157,1155],[1158,1156],[1159,1157],[1160,1158],[1161,1159],[1162,1160],[1163,1161],[1164,1162],[1165,1163],[1166,1164],[1167,1165],[1168,1166],[1169,1167],[1170,1168],[1171,1169],[1172,1170],[1173,1171],[1174,1172],[1175,1173],[1176,1174],[1177,1175],[1178,1176],[1179,1177],[1180,1178],[1181,1179],[1182,1180],[1183,1181],[1184,1182],[1185,1183],[1186,1184],[1187,1185],[1188,1186],[1189,1187],[1190,1188],[1191,1189],[1192,1190],[1193,1191],[1194,1192],[1195,1193],[1196,1194],[1197,1195],[1198,1196],[1199,1197],[1200,1198],[1201,1199],[1202,1200],[1203,1201],[1204,1202],[1205,1203],[1206,1204],[1207,1205],[1208,1206],[1209,1207],[1210,1208],[1211,1209],[1212,1210],[1213,1211],[1214,1212],[1215,1213],[1216,1214],[1217,1215],[1218,1216],[1219,1217],[1220,1218],[1221,1219],[1222,1220],[1223,1221],[1224,1222],[1225,1223],[1226,1224],[1227,1225],[1228,1226],[1229,1227],[1230,1228],[1231,1229],[1232,1230],[1233,1231],[1234,1232],[1235,1233],[1236,1234],[1237,1235],[1238,1236],[1239,1237],[1240,1238],[1241,1239],[1242,1240],[1243,1241],[1244,1242],[1245,1243],[1246,1244],[1247,1245],[1248,1246],[1249,1247],[1250,1248],[1251,1249],[1252,1250],[1253,1251],[1254,1252],[1255,1253],[1256,1254],[1257,1255],[1258,1256],[1259,1257],[1260,1258],[1261,1259],[1262,1260],[1263,1261],[1264,1262],[1265,1263],[1266,1264],[1267,1265],[1268,1266],[1269,1267],[1270,1268],[1271,1269],[1272,1270],[1273,1271],[1274,1272],[1275,1273],[1276,1274],[1277,1275],[1278,1276],[1279,1277],[1280,1278],[1281,1279],[1282,1280],[1283,1281],[1284,1282],[1285,1283],[1286,1284],[1287,1285],[1288,1286],[1289,1287],[1290,1288],[1291,1289],[1292,1290],[1293,1291],[1294,1292],[1295,1293],[1296,1294],[1297,1295],[1298,1296],[1299,1297],[1300,1298],[1301,1299],[1302,1300],[1303,1301],[1304,1302],[1305,1303],[1306,1304],[1307,1305],[1308,1306],[1309,1307],[1310,1308],[1311,1309],[1312,1310],[1313,1311],[1314,1312],[1315,1313],[1316,1314],[1317,1315],[1318,1316],[1319,1317],[1320,1318],[1321,1319],[1322,1320],[1323,1321],[1324,1322],[1325,1323],[1326,1324],[1327,1325],[1328,1326],[1329,1327],[1330,1328],[1331,1329],[1332,1330],[1333,1331],[1334,1332],[1335,1333],[1336,1334],[1337,1335],[1338,1336],[1339,1337],[1340,1338],[1341,1339],[1342,1340],[1343,1341],[1344,1342],[1345,1343],[1346,1344],[1347,1345],[1348,1346],[1349,1347],[1350,1348],[1351,1349],[1352,1350],[1353,1351],[1354,1352],[1355,1353],[1356,1354],[1357,1355],[1358,1356],[1359,1357],[1360,1358],[1361,1359],[1362,1360],[1363,1361],[1364,1362],[1365,1363],[1366,1364],[1367,1365],[1368,1366],[1369,1367],[1370,1368],[1371,1369],[1372,1370],[1373,1371],[1374,1372],[1375,1373],[1376,1374],[1377,1375],[1378,1376],[1379,1377],[1380,1378],[1381,1379],[1382,1380],[1383,1381],[1384,1382],[1385,1383],[1386,1384],[1387,1385],[1388,1386],[1389,1387],[1390,1388],[1391,1389],[1392,1390],[1393,1391],[1394,1392],[1395,1393],[1396,1394],[1397,1395],[1398,1396],[1399,1397],[1400,1398],[1401,1399],[1402,1400],[1403,1401],[1404,1402],[1405,1403],[1406,1404],[1407,1405],[1408,1406],[1409,1407],[1410,1408],[1411,1409],[1412,1410],[1413,1411],[1414,1412],[1415,1413],[1416,1414],[1417,1415],[1418,1416],[1419,1417],[1420,1418],[1421,1419],[1422,1420],[1423,1421],[1424,1422],[1425,1423],[1426,1424],[1427,1425],[1428,1426],[1429,1427],[1430,1428],[1431,1429],[1432,1430],[1433,1431],[1434,1432],[1435,1433],[1436,1434],[1437,1435],[1438,1436],[1439,1437],[1440,1438],[1441,1439],[1442,1440],[1443,1441],[1444,1442],[1445,1443],[1446,1444],[1447,1445],[1448,1446],[1449,1447],[1450,1448],[1451,1449],[1452,1450],[1453,1451],[1454,1452],[1455,1453],[1456,1454],[1457,1455],[1458,1456],[1459,1457],[1460,1458],[1461,1459],[1462,1460],[1463,1461],[1464,1462],[1465,1463],[1466,1464],[1467,1465],[1468,1466],[1469,1467],[1470,1468],[1471,1469],[1472,1470],[1473,1471],[1474,1472],[1475,1473],[1476,1474],[1477,1475],[1478,1476],[1479,1477],[1480,1478],[1481,1479],[1482,1480],[1483,1481],[1484,1482],[1485,1483],[1486,1484],[1487,1485],[1488,1486],[1489,1487],[1490,1488],[1491,1489],[1492,1490],[1493,1491],[1494,1492],[1495,1493],[1496,1494],[1497,1495],[1498,1496],[1499,1497],[1500,1498],[1501,1499],[1502,1500],[1503,1501],[1504,1502],[1505,1503],[1506,1504],[1507,1505],[1508,1506],[1509,1507],[1510,1508],[1511,1509],[1512,1510],[1513,1511],[1514,1512],[1515,1513],[1516,1514],[1517,1515],[1518,1516],[1519,1517],[1520,1518],[1521,1519],[1522,1520],[1523,1521],[1524,1522],[1525,1523],[1526,1524],[1527,1525],[1528,1526],[1529,1527],[1530,1528],[1531,1529],[1532,1530],[1533,1531],[1534,1532],[1535,1533],[1536,1534],[1537,1535],[1538,1536],[1539,1537],[1540,1538],[1541,1539],[1542,1540],[1543,1541],[1544,1542],[1545,1543],[1546,1544],[1547,1545],[1548,1546],[1549,1547],[1550,1548],[1551,1549],[1552,1550],[1553,1551],[1554,1552],[1555,1553],[1556,1554],[1557,1555],[1558,1556],[1559,1557],[1560,1558],[1561,1559],[1562,1560],[1563,1561],[1564,1562],[1565,1563],[1566,1564],[1567,1565],[1568,1566],[1569,1567],[1570,1568],[1571,1569],[1572,1570],[1573,1571],[1574,1572],[1575,1573],[1576,1574],[1577,1575],[1578,1576],[1579,1577],[1580,1578],[1581,1579],[1582,1580],[1583,1581],[1584,1582],[1585,1583],[1586,1584],[1587,1585],[1588,1586],[1589,1587],[1590,1588],[1591,1589],[1592,1590],[1593,1591],[1594,1592],[1595,1593],[1596,1594],[1597,1595],[1598,1596],[1599,1597],[1600,1598],[1601,1599],[1602,1600],[1603,1601],[1604,1602],[1605,1603],[1606,1604],[1607,1605],[1608,1606],[1609,1607],[1610,1608],[1611,1609],[1612,1610],[1613,1611],[1614,1612],[1615,1613],[1616,1614],[1617,1615],[1618,1616],[1619,1617],[1620,1618],[1621,1619],[1622,1620],[1623,1621],[1624,1622],[1625,1623],[1626,1624],[1627,1625],[1628,1626],[1629,1627],[1630,1628],[1631,1629],[1632,1630],[1633,1631],[1634,1632],[1635,1633],[1636,1634],[1637,1635],[1638,1636],[1639,1637],[1640,1638],[1641,1639],[1642,1640],[1643,1641],[1644,1642],[1645,1643],[1646,1644],[1647,1645],[1648,1646],[1649,1647],[1650,1648],[1651,1649],[1652,1650],[1653,1651],[1654,1652],[1655,1653],[1656,1654],[1657,1655],[1658,1656],[1659,1657],[1660,1658],[1661,1659],[1662,1660],[1663,1661],[1664,1662],[1665,1663],[1666,1664],[1667,1665],[1668,1666],[1669,1667],[1670,1668],[1671,1669],[1672,1670],[1673,1671],[1674,1672],[1675,1673],[1676,1674],[1677,1675],[1678,1676],[1679,1677],[1680,1678],[1681,1679],[1682,1680],[1683,1681],[1684,1682],[1685,1683],[1686,1684],[1687,1685],[1688,1686],[1689,1687],[1690,1688],[1691,1689],[1692,1690],[1693,1691],[1694,1692],[1695,1693],[1696,1694],[1697,1695],[1698,1696],[1699,1697],[1700,1698],[1701,1699],[1702,1700],[1703,1701],[1704,1702],[1705,1703],[1706,1704],[1707,1705],[1708,1706],[1709,1707],[1710,1708],[1711,1709],[1712,1710],[1713,1711],[1714,1712],[1715,1713],[1716,1714],[1717,1715],[1718,1716],[1719,1717],[1720,1718],[1721,1719],[1722,1720],[1723,1721],[1724,1722],[1725,1723],[1726,1724],[1727,1725],[1728,1726],[1729,1727],[1730,1728],[1731,1729],[1732,1730],[1733,1731],[1734,1732],[1735,1733],[1736,1734],[1737,1735],[1738,1736],[1739,1737],[1740,1738],[1741,1739],[1742,1740],[1743,1741],[1744,1742],[1745,1743],[1746,1744],[1747,1745],[1748,1746],[1749,1747],[1750,1748],[1751,1749],[1752,1750],[1753,1751],[1754,1752],[1755,1753],[1756,1754],[1757,1755],[1758,1756],[1759,1757],[1760,1758],[1761,1759],[1762,1760],[1763,1761],[1764,1762],[1765,1763],[1766,1764],[1767,1765],[1768,1766],[1769,1767],[1770,1768],[1771,1769],[1772,1770],[1773,1771],[1774,1772],[1775,1773],[1776,1774],[1777,1775],[1778,1776],[1779,1777],[1780,1778],[1781,1779],[1782,1780],[1783,1781],[1784,1782],[1785,1783],[1786,1784],[1787,1785],[1788,1786],[1789,1787],[1790,1788],[1791,1789],[1792,1790],[1793,1791],[1794,1792],[1795,1793],[1796,1794],[1797,1795],[1798,1796],[1799,1797],[1800,1798],[1801,1799],[1802,1800],[1803,1801],[1804,1802],[1805,1803],[1806,1804],[1807,1805],[1808,1806],[1809,1807],[1810,1808],[1811,1809],[1812,1810],[1813,1811],[1814,1812],[1815,1813],[1816,1814],[1817,1815],[1818,1816],[1819,1817],[1820,1818],[1821,1819],[1822,1820],[1823,1821],[1824,1822],[1825,1823],[1826,1824],[1827,1825],[1828,1826],[1829,1827],[1830,1828],[1831,1829],[1832,1830],[1833,1831],[1834,1832],[1835,1833],[1836,1834],[1837,1835],[1838,1836],[1839,1837],[1840,1838],[1841,1839],[1842,1840],[1843,1841],[1844,1842],[1845,1843],[1846,1844],[1847,1845],[1848,1846],[1849,1847],[1850,1848],[1851,1849],[1852,1850],[1853,1851],[1854,1852],[1855,1853],[1856,1854],[1857,1855],[1858,1856],[1859,1857],[1860,1858],[1861,1859],[1862,1860],[1863,1861],[1864,1862],[1865,1863],[1866,1864],[1867,1865],[1868,1866],[1869,1867],[1870,1868],[1871,1869],[1872,1870],[1873,1871],[1874,1872],[1875,1873],[1876,1874],[1877,1875],[1878,1876],[1879,1877],[1880,1878],[1881,1879],[1882,1880],[1883,1881],[1884,1882],[1885,1883],[1886,1884],[1887,1885],[1888,1886],[1889,1887],[1890,1888],[1891,1889],[1892,1890],[1893,1891],[1894,1892],[1895,1893],[1896,1894],[1897,1895],[1898,1896],[1899,1897],[1900,1898],[1901,1899],[1902,1900],[1903,1901],[1904,1902],[1905,1903],[1906,1904],[1907,1905],[1908,1906],[1909,1907],[1910,1908],[1911,1909],[1912,1910],[1913,1911],[1914,1912],[1915,1913],[1916,1914],[1917,1915],[1918,1916],[1919,1917],[1920,1918],[1921,1919],[1922,1920],[1923,1921],[1924,1922],[1925,1923],[1926,1924],[1927,1925],[1928,1926],[1929,1927],[1930,1928],[1931,1929],[1932,1930],[1933,1931],[1934,1932],[1935,1933],[1936,1934],[1937,1935],[1938,1936],[1939,1937],[1940,1938],[1941,1939],[1942,1940],[1943,1941],[1944,1942],[1945,1943],[1946,1944],[1947,1945],[1948,1946],[1949,1947],[1950,1948],[1951,1949],[1952,1950],[1953,1951],[1954,1952],[1955,1953],[1956,1954],[1957,1955],[1958,1956],[1959,1957],[1960,1958],[1961,1959],[1962,1960],[1963,1961],[1964,1962],[1965,1963],[1966,1964],[1967,1965],[1968,1966],[1969,1967],[1970,1968],[1971,1969],[1972,1970],[1973,1971],[1974,1972],[1975,1973],[1976,1974],[1977,1975],[1978,1976],[1979,1977],[1980,1978],[1981,1979],[1982,1980],[1983,1981],[1984,1982],[1985,1983],[1986,1984],[1987,1985],[1988,1986],[1989,1987],[1990,1988],[1991,1989],[1992,1990],[1993,1991],[1994,1992],[1995,1993],[1996,1994],[1997,1995],[1998,1996],[1999,1997],[3,0],[4,1],[5,2],[6,3],[7,4],[8,5],[9,6],[10,7],[11,8],[12,9],[13,10],[14,11],[15,12],[16,13],[17,14],[18,15],[19,16],[20,17],[21,18],[22,19],[23,20],[24,21],[25,22],[26,23],[27,24],[28,25],[29,26],[30,27],[31,28],[32,29],[33,30],[34,31],[35,32],[36,33],[37,34],[38,35],[39,36],[40,37],[41,38],[42,39],[43,40],[44,41],[45,42],[46,43],[47,44],[48,45],[49,46],[50,47],[51,48],[52,49],[53,50],[54,51],[55,52],[56,53],[57,54],[58,55],[59,56],[60,57],[61,58],[62,59],[63,60],[64,61],[65,62],[66,63],[67,64],[68,65],[69,66],[70,67],[71,68],[72,69],[73,70],[74,71],[75,72],[76,73],[77,74],[78,75],[79,76],[80,77],[81,78],[82,79],[83,80],[84,81],[85,82],[86,83],[87,84],[88,85],[89,86],[90,87],[91,88],[92,89],[93,90],[94,91],[95,92],[96,93],[97,94],[98,95],[99,96],[100,97],[101,98],[102,99],[103,100],[104,101],[105,102],[106,103],[107,104],[108,105],[109,106],[110,107],[111,108],[112,109],[113,110],[114,111],[115,112],[116,113],[117,114],[118,115],[119,116],[120,117],[121,118],[122,119],[123,120],[124,121],[125,122],[126,123],[127,124],[128,125],[129,126],[130,127],[131,128],[132,129],[133,130],[134,131],[135,132],[136,133],[137,134],[138,135],[139,136],[140,137],[141,138],[142,139],[143,140],[144,141],[145,142],[146,143],[147,144],[148,145],[149,146],[150,147],[151,148],[152,149],[153,150],[154,151],[155,152],[156,153],[157,154],[158,155],[159,156],[160,157],[161,158],[162,159],[163,160],[164,161],[165,162],[166,163],[167,164],[168,165],[169,166],[170,167],[171,168],[172,169],[173,170],[174,171],[175,172],[176,173],[177,174],[178,175],[179,176],[180,177],[181,178],[182,179],[183,180],[184,181],[185,182],[186,183],[187,184],[188,185],[189,186],[190,187],[191,188],[192,189],[193,190],[194,191],[195,192],[196,193],[197,194],[198,195],[199,196],[200,197],[201,198],[202,199],[203,200],[204,201],[205,202],[206,203],[207,204],[208,205],[209,206],[210,207],[211,208],[212,209],[213,210],[214,211],[215,212],[216,213],[217,214],[218,215],[219,216],[220,217],[221,218],[222,219],[223,220],[224,221],[225,222],[226,223],[227,224],[228,225],[229,226],[230,227],[231,228],[232,229],[233,230],[234,231],[235,232],[236,233],[237,234],[238,235],[239,236],[240,237],[241,238],[242,239],[243,240],[244,241],[245,242],[246,243],[247,244],[248,245],[249,246],[250,247],[251,248],[252,249],[253,250],[254,251],[255,252],[256,253],[257,254],[258,255],[259,256],[260,257],[261,258],[262,259],[263,260],[264,261],[265,262],[266,263],[267,264],[268,265],[269,266],[270,267],[271,268],[272,269],[273,270],[274,271],[275,272],[276,273],[277,274],[278,275],[279,276],[280,277],[281,278],[282,279],[283,280],[284,281],[285,282],[286,283],[287,284],[288,285],[289,286],[290,287],[291,288],[292,289],[293,290],[294,291],[295,292],[296,293],[297,294],[298,295],[299,296],[300,297],[301,298],[302,299],[303,300],[304,301],[305,302],[306,303],[307,304],[308,305],[309,306],[310,307],[311,308],[312,309],[313,310],[314,311],[315,312],[316,313],[317,314],[318,315],[319,316],[320,317],[321,318],[322,319],[323,320],[324,321],[325,322],[326,323],[327,324],[328,325],[329,326],[330,327],[331,328],[332,329],[333,330],[334,331],[335,332],[336,333],[337,334],[338,335],[339,336],[340,337],[341,338],[342,339],[343,340],[344,341],[345,342],[346,343],[347,344],[348,345],[349,346],[350,347],[351,348],[352,349],[353,350],[354,351],[355,352],[356,353],[357,354],[358,355],[359,356],[360,357],[361,358],[362,359],[363,360],[364,361],[365,362],[366,363],[367,364],[368,365],[369,366],[370,367],[371,368],[372,369],[373,370],[374,371],[375,372],[376,373],[377,374],[378,375],[379,376],[380,377],[381,378],[382,379],[383,380],[384,381],[385,382],[386,383],[387,384],[388,385],[389,386],[390,387],[391,388],[392,389],[393,390],[394,391],[395,392],[396,393],[397,394],[398,395],[399,396],[400,397],[401,398],[402,399],[403,400],[404,401],[405,402],[406,403],[407,404],[408,405],[409,406],[410,407],[411,408],[412,409],[413,410],[414,411],[415,412],[416,413],[417,414],[418,415],[419,416],[420,417],[421,418],[422,419],[423,420],[424,421],[425,422],[426,423],[427,424],[428,425],[429,426],[430,427],[431,428],[432,429],[433,430],[434,431],[435,432],[436,433],[437,434],[438,435],[439,436],[440,437],[441,438],[442,439],[443,440],[444,441],[445,442],[446,443],[447,444],[448,445],[449,446],[450,447],[451,448],[452,449],[453,450],[454,451],[455,452],[456,453],[457,454],[458,455],[459,456],[460,457],[461,458],[462,459],[463,460],[464,461],[465,462],[466,463],[467,464],[468,465],[469,466],[470,467],[471,468],[472,469],[473,470],[474,471],[475,472],[476,473],[477,474],[478,475],[479,476],[480,477],[481,478],[482,479],[483,480],[484,481],[485,482],[486,483],[487,484],[488,485],[489,486],[490,487],[491,488],[492,489],[493,490],[494,491],[495,492],[496,493],[497,494],[498,495],[499,496],[500,497],[501,498],[502,499],[503,500],[504,501],[505,502],[506,503],[507,504],[508,505],[509,506],[510,507],[511,508],[512,509],[513,510],[514,511],[515,512],[516,513],[517,514],[518,515],[519,516],[520,517],[521,518],[522,519],[523,520],[524,521],[525,522],[526,523],[527,524],[528,525],[529,526],[530,527],[531,528],[532,529],[533,530],[534,531],[535,532],[536,533],[537,534],[538,535],[539,536],[540,537],[541,538],[542,539],[543,540],[544,541],[545,542],[546,543],[547,544],[548,545],[549,546],[550,547],[551,548],[552,549],[553,550],[554,551],[555,552],[556,553],[557,554],[558,555],[559,556],[560,557],[561,558],[562,559],[563,560],[564,561],[565,562],[566,563],[567,564],[568,565],[569,566],[570,567],[571,568],[572,569],[573,570],[574,571],[575,572],[576,573],[577,574],[578,575],[579,576],[580,577],[581,578],[582,579],[583,580],[584,581],[585,582],[586,583],[587,584],[588,585],[589,586],[590,587],[591,588],[592,589],[593,590],[594,591],[595,592],[596,593],[597,594],[598,595],[599,596],[600,597],[601,598],[602,599],[603,600],[604,601],[605,602],[606,603],[607,604],[608,605],[609,606],[610,607],[611,608],[612,609],[613,610],[614,611],[615,612],[616,613],[617,614],[618,615],[619,616],[620,617],[621,618],[622,619],[623,620],[624,621],[625,622],[626,623],[627,624],[628,625],[629,626],[630,627],[631,628],[632,629],[633,630],[634,631],[635,632],[636,633],[637,634],[638,635],[639,636],[640,637],[641,638],[642,639],[643,640],[644,641],[645,642],[646,643],[647,644],[648,645],[649,646],[650,647],[651,648],[652,649],[653,650],[654,651],[655,652],[656,653],[657,654],[658,655],[659,656],[660,657],[661,658],[662,659],[663,660],[664,661],[665,662],[666,663],[667,664],[668,665],[669,666],[670,667],[671,668],[672,669],[673,670],[674,671],[675,672],[676,673],[677,674],[678,675],[679,676],[680,677],[681,678],[682,679],[683,680],[684,681],[685,682],[686,683],[687,684],[688,685],[689,686],[690,687],[691,688],[692,689],[693,690],[694,691],[695,692],[696,693],[697,694],[698,695],[699,696],[700,697],[701,698],[702,699],[703,700],[704,701],[705,702],[706,703],[707,704],[708,705],[709,706],[710,707],[711,708],[712,709],[713,710],[714,711],[715,712],[716,713],[717,714],[718,715],[719,716],[720,717],[721,718],[722,719],[723,720],[724,721],[725,722],[726,723],[727,724],[728,725],[729,726],[730,727],[731,728],[732,729],[733,730],[734,731],[735,732],[736,733],[737,734],[738,735],[739,736],[740,737],[741,738],[742,739],[743,740],[744,741],[745,742],[746,743],[747,744],[748,745],[749,746],[750,747],[751,748],[752,749],[753,750],[754,751],[755,752],[756,753],[757,754],[758,755],[759,756],[760,757],[761,758],[762,759],[763,760],[764,761],[765,762],[766,763],[767,764],[768,765],[769,766],[770,767],[771,768],[772,769],[773,770],[774,771],[775,772],[776,773],[777,774],[778,775],[779,776],[780,777],[781,778],[782,779],[783,780],[784,781],[785,782],[786,783],[787,784],[788,785],[789,786],[790,787],[791,788],[792,789],[793,790],[794,791],[795,792],[796,793],[797,794],[798,795],[799,796],[800,797],[801,798],[802,799],[803,800],[804,801],[805,802],[806,803],[807,804],[808,805],[809,806],[810,807],[811,808],[812,809],[813,810],[814,811],[815,812],[816,813],[817,814],[818,815],[819,816],[820,817],[821,818],[822,819],[823,820],[824,821],[825,822],[826,823],[827,824],[828,825],[829,826],[830,827],[831,828],[832,829],[833,830],[834,831],[835,832],[836,833],[837,834],[838,835],[839,836],[840,837],[841,838],[842,839],[843,840],[844,841],[845,842],[846,843],[847,844],[848,845],[849,846],[850,847],[851,848],[852,849],[853,850],[854,851],[855,852],[856,853],[857,854],[858,855],[859,856],[860,857],[861,858],[862,859],[863,860],[864,861],[865,862],[866,863],[867,864],[868,865],[869,866],[870,867],[871,868],[872,869],[873,870],[874,871],[875,872],[876,873],[877,874],[878,875],[879,876],[880,877],[881,878],[882,879],[883,880],[884,881],[885,882],[886,883],[887,884],[888,885],[889,886],[890,887],[891,888],[892,889],[893,890],[894,891],[895,892],[896,893],[897,894],[898,895],[899,896],[900,897],[901,898],[902,899],[903,900],[904,901],[905,902],[906,903],[907,904],[908,905],[909,906],[910,907],[911,908],[912,909],[913,910],[914,911],[915,912],[916,913],[917,914],[918,915],[919,916],[920,917],[921,918],[922,919],[923,920],[924,921],[925,922],[926,923],[927,924],[928,925],[929,926],[930,927],[931,928],[932,929],[933,930],[934,931],[935,932],[936,933],[937,934],[938,935],[939,936],[940,937],[941,938],[942,939],[943,940],[944,941],[945,942],[946,943],[947,944],[948,945],[949,946],[950,947],[951,948],[952,949],[953,950],[954,951],[955,952],[956,953],[957,954],[958,955],[959,956],[960,957],[961,958],[962,959],[963,960],[964,961],[965,962],[966,963],[967,964],[968,965],[969,966],[970,967],[971,968],[972,969],[973,970],[974,971],[975,972],[976,973],[977,974],[978,975],[979,976],[980,977],[981,978],[982,979],[983,980],[984,981],[985,982],[986,983],[987,984],[988,985],[989,986],[990,987],[991,988],[992,989],[993,990],[994,991],[995,992],[996,993],[997,994],[998,995],[999,996],[1000,997],[1001,998],[1002,999],[1003,1000],[1004,1001],[1005,1002]]"]], "expected": [[0], [0, 1], [0, 1], [1, 0], [], [0, 1, 2], [2, 1, 0], [0, 1, 2], [0, 1, 2], [], [], [0, 1, 2, 3], [0, 1, 2, 3], [3, 0, 1, 2], [0, 1, 2, 3], [], [], [0, 2, 1, 3], [], [0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 4, 1, 2, 3], [0, 1, 2, 3, 4], [], [], [0, 1, 2, 3, 4], [4, 0, 1, 2, 3], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [0, 1, 3, 2, 4, 5], [], [], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5, 6], [], [0, 1, 3, 5, 2, 4, 6], [0, 2, 4, 1, 3, 5, 6], [0, 1, 2, 3, 4, 5, 6, 7], [], [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7, 8], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [], [0, 1, 3, 4, 6, 7, 9, 10, 12, 13, 2, 5, 8, 11, 14], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [0, 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, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1649, 1650, 1651, 1652, 1653, 1654, 1655, 1656, 1657, 1658, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 1672, 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "652", "slug": "course-schedule-iii", "id": 652, "title": "Course Schedule III", "difficulty": "Hard", "category": "heap", "link": "https://leetcode.com/problems/course-schedule-iii/", "examples": [{"input": "courses = [[100,200],[200,1300],[1000,1250],[2000,3200]]", "output": "3", "explanation": "Take the first three courses (100 + 200 + 1000 = 1300 by day 1300); the 2000-long course cannot fit."}, {"input": "courses = [[1,2]]", "output": "1", "explanation": "The single course finishes exactly on time."}, {"input": "courses = [[3,2],[4,3]]", "output": "0", "explanation": "Each course alone already misses its deadline."}], "hints": ["Order courses by deadline so earlier cutoffs are considered first.", "Keep taken durations in a max-heap plus their running total.", "When the total passes the current deadline, drop the longest taken course; the heap size at the end is the answer."], "statement": "You are given course pairs `[duration, lastDay]`: a course consumes `duration` consecutive days and must end no later than `lastDay`. You may take courses in any order, one at a time, starting on day 1 (a course needing `d` days taken first ends on day `d`).\n\nReturn the greatest number of courses you can complete without missing any chosen deadline.\n\n**Constraints:**\n- Between 1 and 10000 courses.\n- Each duration and deadline lies in [1, 10000].\n\n*Adaptation: the nested input maps to `int_array_2d` in this judge.*\n", "solution": "## Approach\n\nSort by deadline, then greedily accept each course while tracking total study time. Store accepted durations in a max-heap; whenever the running total overshoots the current deadline, evict the longest accepted course (the cheapest way to recover feasibility). Courses surviving this filter form the largest feasible set.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n log n) for sorting plus heap updates.\n- **Space Complexity:** O(n) for the heap in the worst case.\n\n## Implementation\n\n```python\nfrom typing import List\nimport heapq\nclass Solution:\n def scheduleCourse(self, courses: List[List[int]]) -> int:\n courses.sort(key=lambda c: c[1])\n bpm = []\n time = 0\n for d, last in courses:\n time += d\n heapq.heappush(bpm, -d)\n if time > last:\n time += heapq.heappop(bpm)\n return len(bpm)\n```\n", "starter": {"go": "package main\n\nfunc ScheduleCourse(courses [][]int) int {\n \n}", "python": "from typing import List\nclass Solution:\n def scheduleCourse(self, courses: List[List[int]]) -> int:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int scheduleCourse(vector<vector<int>>& courses) {\n return 0;\n }\n};"}, "fn": "scheduleCourse", "params": [{"name": "courses", "type": "int_array_2d"}], "outputType": "int", "tests": [["[[100,200],[200,1300],[1000,1250],[2000,3200]]"], ["[[1,2]]"], ["[[3,2],[4,3]]"], ["[[5,5],[4,6],[2,6]]"], ["[[1,2],[2,3]]"], ["[[7,16],[2,3],[3,12],[3,14],[10,19],[10,16],[6,8],[6,11],[3,13],[6,16]]"], ["[[1,10],[2,10],[3,10]]"], ["[[5,5]]"], ["[[10,5]]"], ["[[2,2],[2,2],[2,2]]"], ["[[1,2],[1,3],[1,4]]"], ["[[100,100]]"], ["[[3,5],[2,6],[4,7]]"], ["[[1,3],[2,4],[3,5],[4,6]]"], ["[[5,10],[10,5]]"], ["[[2,5],[2,6],[2,7],[2,8]]"], ["[[9,10],[8,11],[7,12]]"], ["[[1,2],[2,2]]"], ["[[4,4],[3,5],[2,6],[1,7]]"], ["[[6,10],[5,10],[4,10]]"], ["[[10000,10000]]"], ["[[1,10000]]"], ["[[2,3],[3,4],[4,5],[5,6],[6,7]]"], ["[[7,7],[8,8]]"], ["[[3,10],[5,12],[7,15],[4,8]]"], ["[[1,2],[3,4],[5,6]]"], ["[[2,4],[3,5],[1,2]]"], ["[[10,20],[5,15],[7,18]]"]], "expected": [3, 1, 0, 2, 2, 4, 3, 1, 0, 1, 3, 1, 2, 2, 1, 4, 1, 1, 3, 2, 1, 1, 1, 1, 3, 2, 2, 2], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "219", "slug": "course-schedule-iv", "id": 219, "title": "Course Schedule IV", "difficulty": "Medium", "category": "graph", "link": "https://leetcode.com/problems/course-schedule-iv/", "examples": [{"input": "numCourses = 2, prerequisites = [[1,0]], queries = [[0,1],[1,0]]", "output": "[false,true]"}, {"input": "numCourses = 2, prerequisites = [], queries = [[1,0],[0,1]]", "output": "[false,false]"}, {"input": "numCourses = 3, prerequisites = [[1,2],[1,0],[2,0]], queries = [[1,0],[1,2]]", "output": "[true,true]"}], "hints": ["Build reachability via Floyd-Warshall or DFS from each course."], "statement": "There are `numCourses` subjects numbered `0` through `numCourses - 1`. An entry `prerequisites[i] = [ai, bi]` declares that subject `ai` has to precede subject `bi`.\n\nDependence carries transitively: whenever `a` must precede `b` and `b` must precede `c`, then `a` must also precede `c`.\n\nYou additionally receive a list `queries`, where each `queries[j] = [uj, vj]` asks whether subject `uj` is a (direct or indirect) requirement of subject `vj`.\n\nRespond with a boolean array `answer`, whose `j`-th slot answers the `j`-th query.\n\n**Note:** In this judge the returned collection uses the strings `\"true\"` and `\"false\"`.\n\n**Constraints:**\n- `2 <= numCourses <= 100`\n- `0 <= prerequisites.length <= (numCourses * (numCourses - 1) / 2)`\n- `prerequisites[i].length == 2`\n- `0 <= ai, bi <= numCourses - 1`\n- `ai != bi`\n- All pairs `[ai, bi]` are unique\n- The prerequisites graph has no cycles\n- `1 <= queries.length <= 10^4`\n- `0 <= ui, vi <= numCourses - 1`\n- `ui != vi`\n", "solution": "## Approach\n\nFloyd-Warshall reachability on the prerequisite graph, then answer each query in O(1).\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n^3 + q)\n- **Space Complexity:** O(n^2)\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def checkIfPrerequisite(self, numCourses: int, prerequisites: List[List[int]], queries: List[List[int]]):\n reach = [[False]*numCourses for _ in range(numCourses)]\n for a, b in prerequisites:\n reach[a][b] = True\n for k in range(numCourses):\n for i in range(numCourses):\n if reach[i][k]:\n for j in range(numCourses):\n if reach[k][j]:\n reach[i][j] = True\n # return list of bool; runner may display as true/false strings via Marker path\n return [\"true\" if reach[u][v] else \"false\" for u, v in queries]\n```\n", "starter": {"go": "package main\n\nfunc CheckIfPrerequisite(numCourses int, prerequisites [][]int, queries [][]int) []string {\n return nil\n}", "python": "from typing import List\nclass Solution:\n def checkIfPrerequisite(self, numCourses: int, prerequisites: List[List[int]], queries: List[List[int]]) -> List[str]:\n ", "cpp": "#include <vector>\n#include <string>\nusing namespace std;\n\nclass Solution {\npublic:\n vector<string> checkIfPrerequisite(int numCourses, vector<vector<int>>& prerequisites, vector<vector<int>>& queries) {\n return {};\n }\n};"}, "fn": "checkIfPrerequisite", "params": [{"name": "numCourses", "type": "int"}, {"name": "prerequisites", "type": "int_array_2d"}, {"name": "queries", "type": "int_array_2d"}], "outputType": "string_list", "tests": [["2", "[[1,0]]", "[[0,1],[1,0]]"], ["2", "[]", "[[1,0],[0,1]]"], ["3", "[[1,2],[1,0],[2,0]]", "[[1,0],[1,2]]"], ["3", "[[1,0],[2,0]]", "[[1,2],[2,1]]"], ["4", "[[0,1],[1,2],[2,3]]", "[[0,3],[3,0],[1,3]]"], ["5", "[[0,1],[1,2],[2,3],[3,4]]", "[[0,4],[1,3],[4,0]]"], ["3", "[[0,1],[0,2]]", "[[0,1],[0,2],[1,2]]"], ["2", "[[0,1]]", "[[0,1]]"], ["4", "[[3,2],[2,1],[1,0]]", "[[3,0],[2,0],[0,3]]"], ["4", "[[0,1],[0,2],[1,3],[2,3]]", "[[0,3],[1,2],[2,1]]"], ["5", "[[4,0],[4,1],[4,2],[4,3]]", "[[4,0],[4,3],[0,4],[1,2]]"], ["6", "[[5,4],[4,3],[3,2],[2,1],[1,0]]", "[[5,0],[3,1],[0,5]]"], ["3", "[]", "[[0,1],[1,2],[2,0]]"], ["6", "[[0,1],[2,1],[2,3],[4,3],[4,5]]", "[[0,1],[2,5],[0,3]]"], ["4", "[[1,0],[2,0],[3,0]]", "[[1,0],[2,0],[0,1],[1,2]]"], ["5", "[[0,1],[1,2],[0,2],[3,4]]", "[[0,2],[1,2],[3,4],[2,0],[0,4]]"], ["7", "[[0,1],[1,2],[3,4],[4,5]]", "[[0,2],[3,5],[0,5],[2,0]]"], ["2", "[[1,0]]", "[[1,0]]"], ["5", "[[2,0],[2,1],[3,2],[4,3]]", "[[4,0],[4,1],[3,0],[0,4]]"], ["6", "[[0,2],[1,2],[2,3],[2,4],[3,5],[4,5]]", "[[0,5],[1,5],[0,1],[3,4]]"], ["8", "[[0,1],[1,2],[2,3],[4,5],[5,6],[6,7]]", "[[0,3],[4,7],[0,7],[3,0]]"], ["4", "[[2,0],[3,1]]", "[[2,0],[3,1],[2,1],[0,2]]"], ["5", "[]", "[[0,1],[2,3],[4,0]]"], ["6", "[[1,0],[2,0],[3,1],[4,1],[5,2]]", "[[3,0],[4,0],[5,0],[0,3]]"], ["10", "[[0,1],[1,2],[2,3],[5,6],[6,7]]", "[[0,3],[5,7],[0,7],[3,0],[8,9]]"], ["3", "[[2,0],[2,1]]", "[[2,0],[2,1],[0,1]]"], ["4", "[[3,0],[3,1],[3,2]]", "[[3,2],[0,1],[3,0]]"], ["9", "[[1,0],[2,1],[3,2],[5,4],[6,5],[7,6]]", "[[1,3],[5,7],[1,7]]"], ["6", "[[0,1],[0,3],[1,2],[3,4],[4,5]]", "[[0,2],[0,5],[2,5],[1,4]]"], ["7", "[[6,0],[6,1],[0,2],[1,3],[2,4],[3,5]]", "[[6,4],[6,5],[0,5],[2,3]]"]], "expected": [["false", "true"], ["false", "false"], ["true", "true"], ["false", "false"], ["true", "false", "true"], ["true", "true", "false"], ["true", "true", "false"], ["true"], ["true", "true", "false"], ["true", "false", "false"], ["true", "true", "false", "false"], ["true", "true", "false"], ["false", "false", "false"], ["true", "false", "false"], ["true", "true", "false", "false"], ["true", "true", "true", "false", "false"], ["true", "true", "false", "false"], ["true"], ["true", "true", "true", "false"], ["true", "true", "false", "false"], ["true", "true", "false", "false"], ["true", "true", "false", "false"], ["false", "false", "false"], ["true", "true", "true", "false"], ["true", "true", "false", "false", "false"], ["true", "true", "false"], ["true", "false", "true"], ["false", "false", "false"], ["true", "true", "false", "false"], ["true", "true", "false", "false"]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "28", "slug": "course-schedule", "id": 28, "title": "Course Schedule", "difficulty": "Medium", "category": "graph", "link": "https://leetcode.com/problems/course-schedule/", "examples": [{"input": "numCourses = 2, prerequisites = [[1,0]]", "output": "true", "explanation": "All 2 courses can be completed (no prerequisite cycle)."}, {"input": "numCourses = 2, prerequisites = [[1,0],[0,1]]", "output": "false", "explanation": "A cycle is detected in the prerequisite graph, so all 2 courses cannot be completed."}], "hints": ["Model courses as a directed graph with edges bi->ai. You can finish all courses iff the graph is acyclic. Use Kahn's algorithm (BFS on indegrees) or DFS cycle detection."], "statement": "Given numCourses and a list of prerequisite pairs prerequisites[i] = [ai, bi], return true if you can finish all courses (i.e., the directed graph has no cycle).\n\n**Constraints:**\n\n- 1 \u2264 numCourses \u2264 2000\n- 0 \u2264 prerequisites.length \u2264 5000\n- prerequisites[i].length == 2\n- 0 \u2264 ai, bi < numCourses\n- All the pairs prerequisites[i] are unique.\n", "solution": "## Approach\n\nTopological sort (Kahn's algorithm) counting processed nodes; if all courses are processed there is no cycle.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(V+E)\n- **Space Complexity:** O(V+E)\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:\n adj = [[] for _ in range(numCourses)]\n indeg = [0] * numCourses\n for a, b in prerequisites:\n adj[b].append(a)\n indeg[a] += 1\n q = [i for i in range(numCourses) if indeg[i] == 0]\n cnt = 0\n while q:\n node = q.pop(0)\n cnt += 1\n for nb in adj[node]:\n indeg[nb] -= 1\n if indeg[nb] == 0:\n q.append(nb)\n return cnt == numCourses\n```\n", "starter": {"go": "package main\n\nfunc CanFinish(numCourses int, prerequisites [][]int) bool {\n \n}", "python": "from typing import List\nclass Solution:\n def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:\n pass\n", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n bool canFinish(int numCourses, vector<vector<int>>& prerequisites) {\n return false;\n }\n};"}, "fn": "canFinish", "params": [{"name": "numCourses", "type": "int"}, {"name": "prerequisites", "type": "int_array_2d"}], "outputType": "boolean", "tests": [["2", "[[1,0]]"], ["2", "[[1,0],[0,1]]"], ["5", "[[1,4],[2,4],[3,1],[3,2]]"], ["1", "[]"], ["3", "[[1,0],[2,1]]"], ["3", "[[1,0],[0,2],[2,1]]"], ["4", "[]"], ["4", "[[1,0],[2,0],[3,1],[3,2]]"], ["4", "[[1,0],[2,1],[0,2]]"], ["6", "[[5,0],[4,0],[4,1],[3,2],[2,5],[2,4]]"], ["2", "[]"], ["3", "[]"], ["3", "[[0,1],[0,2]]"], ["3", "[[0,1],[0,2],[1,2]]"], ["4", "[[0,1],[1,2],[2,3],[3,1]]"], ["5", "[[0,1],[1,2],[2,3],[3,4]]"], ["5", "[[0,1],[1,2],[2,3],[3,4],[4,0]]"], ["1", "[[0,0]]"], ["6", "[]"], ["6", "[[1,0],[2,0],[3,1],[4,1],[5,2]]"], ["7", "[[1,0],[2,0],[3,1],[4,2],[5,3],[6,4]]"], ["8", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[7,6]]"], ["8", "[[1,0],[2,1],[3,2],[4,3],[5,4],[6,5],[0,6]]"], ["10", "[[1,0],[3,2],[5,4],[7,6],[9,8]]"], ["10", "[[2,0],[2,1],[3,2],[4,2],[5,3],[5,4]]"], ["4", "[[2,0],[2,1],[3,2]]"], ["5", "[[4,3],[3,2],[2,1],[1,0]]"], ["9", "[[1,0],[0,2],[2,1],[4,3],[5,4],[6,5]]"], ["12", "[[1,0],[2,1],[3,2],[5,4],[6,5],[7,5],[9,8],[10,9],[11,10]]"], ["20", "[[1,0],[2,1],[3,2],[4,3],[6,5],[7,6],[8,7]]"]], "expected": [true, false, true, true, true, false, true, true, false, true, true, true, true, true, false, true, false, false, true, true, true, true, false, true, true, true, true, false, true, true], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "976", "slug": "cousins-in-binary-tree", "id": 976, "title": "Cousins in Binary Tree", "difficulty": "Easy", "category": "tree", "link": "https://leetcode.com/problems/cousins-in-binary-tree/", "examples": [{"input": "root = [1,2,3,4], x = 4, y = 3", "output": "false", "explanation": "Node 4 is at depth 2 while node 3 is at depth 1."}, {"input": "root = [1,2,3,null,4,null,5], x = 5, y = 4", "output": "true", "explanation": "Both nodes are at depth 2 with different parents."}, {"input": "root = [1,2,3,null,4], x = 2, y = 3", "output": "false", "explanation": "Same depth, but they share parent 1, so they are siblings."}], "hints": ["Walk the tree once, remembering each target's depth and parent node.", "Cousins means equal depths with different (non-null) parents; siblings share a parent and fail.", "Adaptation: the tree arrives as a tree_node while x and y are plain integer labels."], "statement": "In a binary tree, two nodes are cousins when they sit at the same depth but have\ndifferent parents. The root is at depth 0, its children at depth 1, and so on.\nEach value in the tree appears exactly once.\n\nGiven the `root` of a binary tree and two distinct values `x` and `y`, return\n`true` if the nodes holding `x` and `y` are cousins, and `false` otherwise.\n\n**Constraints:**\n- The number of nodes is between `2` and `100`.\n- `1 <= Node.val <= 100`\n- All node values are distinct.\n- `x != y` and both values occur in the tree.\n", "solution": "## Approach\n\nDo one depth-first walk carrying each node's parent and depth. When the walk\nreaches the node holding `x`, record its depth and parent; do the same for\n`y`. The two nodes are cousins exactly when both were found, their depths\nmatch, and their parents differ (reference comparison also rules out the\nshared-parent sibling case).\n\n## Complexity Analysis\n\n- **Time Complexity:** O(n), where n is the number of nodes. Each node is visited once.\n- **Space Complexity:** O(h) for the recursion stack, where h is the tree height.\n\n## Implementation\n\n```python\nclass Solution:\n def isCousins(self, root, x: int, y: int) -> bool:\n found = {}\n\n def walk(node, parent, depth):\n if node is None:\n return\n if node.val == x or node.val == y:\n found[node.val] = (depth, parent)\n walk(node.left, node, depth + 1)\n walk(node.right, node, depth + 1)\n\n walk(root, None, 0)\n if x not in found or y not in found:\n return False\n return found[x][0] == found[y][0] and found[x][1] is not found[y][1]\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 IsCousins(root *TreeNode, x int, y int) bool {\n return false\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 isCousins(self, root, x: int, y: int) -> bool:\n return False", "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 bool isCousins(TreeNode* root, int x, int y) {\n return false;\n }\n};"}, "fn": "isCousins", "params": [{"name": "root", "type": "tree_node"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}], "outputType": "boolean", "tests": [["[1,2,3,4]", "4", "3"], ["[1,2,3,null,4,null,5]", "5", "4"], ["[1,2,3,null,4]", "2", "3"], ["[1,2,3,4,5,6,7]", "4", "6"], ["[1,2,3,4,5,6,7]", "4", "5"], ["[1,2,3,4,5,6,7]", "2", "3"], ["[1,2,3,4,5,6,7]", "4", "7"], ["[1,2,3,4,5,6,7]", "1", "2"], ["[1,2,null,3,null,4]", "3", "2"], ["[1,2,3,null,null,4,5]", "4", "5"], ["[1,2,3,null,null,4,5]", "2", "4"], ["[1,2,3,4,null,null,5]", "4", "5"], ["[1,2,3,4,null,null,5]", "4", "3"], ["[5,1,9,2,7,8,3]", "2", "8"], ["[5,1,9,2,7,8,3]", "2", "7"], ["[5,1,9,2,7,8,3]", "1", "9"], ["[5,1,9,2,7,8,3]", "7", "3"], ["[1,2,3,null,4,5,6]", "4", "5"], ["[1,2,3,null,4,5,6]", "4", "6"], ["[1,2,3,null,4,5,6]", "5", "6"], ["[10,20,30,40,50]", "40", "30"], ["[10,20,30,40,50]", "40", "50"], ["[10,20,30,40,50,null,null,60,70]", "60", "50"], ["[10,20,30,40,50,null,60,70,null,null,null,null,80]", "70", "80"], ["[10,20,30,40,50,null,60,70,null,null,null,null,80]", "70", "50"], ["[1,2,3,4,5,null,6,null,null,7,8]", "4", "6"], ["[1,2,3,4,5,null,6,null,null,7,8]", "7", "4"], ["[1,2,3,4,5,null,6,null,null,7,8]", "7", "8"]], "expected": [false, true, false, true, false, false, true, false, false, false, false, true, false, true, false, false, true, true, true, false, false, false, false, true, false, true, false, false], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "755", "slug": "cracking-the-safe", "id": 755, "title": "Cracking the Safe", "difficulty": "Hard", "category": "graph", "link": "https://leetcode.com/problems/cracking-the-safe/", "examples": [{"input": "n = 1, k = 2", "output": "\"01\"", "explanation": "Contains 0 and 1; 10 also works."}, {"input": "n = 2, k = 2", "output": "\"01100\"", "explanation": "Contains 01, 11, 10, 00 exactly once each."}], "hints": ["Model each (n-1)-digit suffix as a graph node with k outgoing edges appending each digit.", "An Euler circuit using every edge once spells a shortest string; visit edges depth-first in post-order to avoid getting stuck.", "The final length must be k^n + n - 1, and the n = 1 case is simply all digits in a row."], "statement": "A safe opens with a secret code of exactly `n` digits, each digit ranging from `0` to `k - 1`. The lock inspects the most recent `n` digits after every key press, so a long typed string can test many codes in a row.\n\nFor example, with code length 3 and typed string `012345`, the lock checks `0`, `01`, `012`, `123`, `234` and finally `345`.\n\nProduce any shortest possible string that contains every one of the `k^n` codes as a contiguous block somewhere inside it. Any minimal answer is accepted.\n\n**Constraints:**\n- `1 <= n <= 4`\n- `1 <= k <= 10`\n- `1 <= k^n <= 4096`\n", "solution": "## Approach\n\nTreat every string of n-1 digits as a graph node with k outgoing edges, one per next digit. Walking each edge exactly once (an Euler circuit) lists every n-digit code once. A depth-first search that appends digits in post-order builds such a circuit; appending the start node gives the full answer of length k^n + n - 1.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(k^n), proportional to the number of codes visited once each.\n- **Space Complexity:** O(k^n) for the seen edge set plus recursion depth.\n\n## Implementation\n\n```python\nclass Solution:\n def crackSafe(self, n: int, k: int) -> str:\n if n == 1:\n return ''.join(str(i) for i in range(k))\n start = '0' * (n - 1)\n seen = set()\n ptr = {}\n node_stack = [start]\n in_stack = [-1]\n circuit = []\n while node_stack:\n node = node_stack[-1]\n i = ptr.get(node, 0)\n if i < k:\n ptr[node] = i + 1\n nei = node + str(i)\n if nei not in seen:\n seen.add(nei)\n node_stack.append(nei[1:])\n in_stack.append(i)\n else:\n node_stack.pop()\n ind = in_stack.pop()\n if ind != -1:\n circuit.append(str(ind))\n circuit.append(start)\n return ''.join(circuit)\n```\n", "starter": {"go": "package main\n\nfunc CrackSafe(n int, k int) string {\n return \"\"\n}", "python": "class Solution:\n def crackSafe(self, n: int, k: int) -> str:\n pass", "cpp": "#include <string>\nusing namespace std;\nclass Solution {\npublic:\n string crackSafe(int n, int k) {\n return \"\";\n }\n};"}, "fn": "crackSafe", "params": [{"name": "n", "type": "int"}, {"name": "k", "type": "int"}], "outputType": "string", "tests": [["1", "1"], ["1", "2"], ["1", "3"], ["1", "10"], ["2", "2"], ["2", "3"], ["2", "4"], ["2", "5"], ["2", "10"], ["3", "2"], ["3", "3"], ["3", "4"], ["3", "5"], ["3", "7"], ["3", "10"], ["4", "2"], ["4", "3"], ["4", "4"], ["4", "5"], ["4", "6"], ["4", "8"], ["1", "5"], ["2", "1"], ["3", "1"], ["4", "1"], ["2", "6"], ["3", "6"], ["4", "7"]], "expected": ["0", "01", "012", "0123456789", "01100", "0221120100", "03322312113020100", "04433423224131211403020100", "09988978779686766958575655948474645449383736353433928272625242322918171615141312119080706050403020100", "0011101000", "00222121112201202101102001000", "003332322233123132122131121113302301303202201203102101103002001000", "0044434333442342432332422322244134124143133123142132122141131121114403402401404303302301304203202201204103102101104003002001000", "006665655566456465455464454446635634636535534536435434436335334333662562462362652552452352642542442342632532432332622522422322266156146136126165155145135125164154144134124163153143133123162152142132122161151141131121116605604603602601606505504503502501506405404403402401406305304303302301306205204203202201206105104103102101106005004003002001000", "009998988899789798788797787779968967969868867869768767769668667666995895795695985885785685975875775675965865765665955855755655599489479469459498488478468458497487477467457496486476466456495485475465455494484474464454449938937936935934939838837836835834839738737736735734739638637636635634639538537536535534539438437436435434439338337336335334333992892792692592492392982882782682582482382972872772672572472372962862762662562462362952852752652552452352942842742642542442342932832732632532432332922822722622522422322299189179169159149139129198188178168158148138128197187177167157147137127196186176166156146136126195185175165155145135125194184174164154144134124193183173163153143133123192182172162152142132122191181171161151141131121119908907906905904903902901909808807806805804803802801809708707706705704703702701709608607606605604603602601609508507506505504503502501509408407406405404403402401409308307306305304303302301309208207206205204203202201209108107106105104103102101109008007006005004003002001000", "0001111010110010000", "000222212122112111122201220212011202022101210211011102010102200120021001100200010000", "0003333232332232222333123313231223131332123213221222131212133112311321122113111211113330233013303230223012303130213011303033202320132032202220122031202120112030202033102310131032102210121031102110111030102010103300230013003200220012003100210011003000200010000", "0004444343443343333444234424342334242443234324332333242323244223422432233224222322224441344124414341334123414241324122414144313431243143313331233142313231223141313144213421242143213321232142213221222141213121214411341124114311331123114211321122114111311121111444034402440144043403340234013404240324022401240414031402140114040443034302430143043303330233013304230323022301230413031302130113040303044203420242014204320332023201320422032202220122041203120212011204020302020441034102410141043103310231013104210321022101210411031102110111040103010201010440034002400140043003300230013004200320022001200410031002100110040003000200010000", "000555545455445444455534553545344535355434543544344435343435533453354334433533343333555245523552545244523452535243523352525542454235425442444234425342434233425242425532453235325432443234325332433233325232423232552245223522542244223422532243223322522242223222255514551355125515451445134512451535143513351235152514251325122515155414541354125415441444134412441534143413341234152414241324122415141415531453135312531543144313431243153314331333123315231423132312231513141313155214521352125215421442134212421532143213321232152214221322122215121412131212155114511351125115411441134112411531143113311231152114211321122115111411131112111155504550355025501550545044503450245014505350435033502350135052504250325022501250515041503150215011505055404540354025401540544044403440244014405340434033402340134052404240324022401240514041403140214011405040405530453035302530153054304430343024301430533043303330233013305230423032302230123051304130313021301130503040303055204520352025201520542044203420242014205320432033202320132052204220322022201220512041203120212011205020402030202055104510351025101510541044103410241014105310431033102310131052104210321022101210511041103110211011105010401030102010105500450035002500150054004400340024001400530043003300230013005200420032002200120051004100310021001100500040003000200010000", "0007777676776676666777567757675667575776567657665666575656577556755765566557555655557774677457747674667456747574657455747477646764576476646664566475646564556474646477546754575476546654565475546554555474546454547744674457447644664456447544654455447444644454444777367735773477376736673567346737573657355734573747364735473447373776367635763476376636663566346637563656355634563746364635463446373636377536753575347537653665356534653755365535553455374536453545344537353635353774367435743474376436643564346437543654355434543744364435443444373436343534343773367335733473376336633563346337533653355334533743364335433443373336333533343333777267725772477237727672667256724672367275726572557245723572747264725472447234727372637253724372337272776267625762476237627662666256624662366275626562556245623562746264625462446234627362636253624362336272626277526752575247523752765266525652465236527552655255524552355274526452545244523452735263525352435233527252625252774267425742474237427642664256424642364275426542554245423542744264425442444234427342634253424342334272426242524242773267325732473237327632663256324632363275326532553245323532743264325432443234327332633253324332333272326232523242323277226722572247223722762266225622462236227522652255224522352274226422542244223422732263225322432233227222622252224222322227771677157714771377127717671667156714671367126717571657155714571357125717471647154714471347124717371637153714371337123717271627152714271327122717177616761576147613761276176616661566146613661266175616561556145613561256174616461546144613461246173616361536143613361236172616261526142613261226171616177516751575147513751275176516651565146513651265175516551555145513551255174516451545144513451245173516351535143513351235172516251525142513251225171516151517741674157414741374127417641664156414641364126417541654155414541354125417441644154414441344124417341634153414341334123417241624152414241324122417141614151414177316731573147313731273176316631563146313631263175316531553145313531253174316431543144313431243173316331533143313331233172316231523142313231223171316131513141313177216721572147213721272176216621562146213621262175216521552145213521252174216421542144213421242173216321532143213321232172216221522142213221222171216121512141213121217711671157114711371127117611661156114611361126117511651155114511351125117411641154114411341124117311631153114311331123117211621152114211321122117111611151114111311121111777067705770477037702770177076706670567046703670267016707570657055704570357025701570747064705470447034702470147073706370537043703370237013707270627052704270327022701270717061705170417031702170117070776067605760476037602760176076606660566046603660266016607560656055604560356025601560746064605460446034602460146073606360536043603360236013607260626052604260326022601260716061605160416031602160116070606077506750575047503750275017507650665056504650365026501650755065505550455035502550155074506450545044503450245014507350635053504350335023501350725062505250425032502250125071506150515041503150215011507050605050774067405740474037402740174076406640564046403640264016407540654055404540354025401540744064405440444034402440144073406340534043403340234013407240624052404240324022401240714061405140414031402140114070406040504040773067305730473037302730173076306630563046303630263016307530653055304530353025301530743064305430443034302430143073306330533043303330233013307230623052304230323022301230713061305130413031302130113070306030503040303077206720572047203720272017207620662056204620362026201620752065205520452035202520152074206420542044203420242014207320632053204320332023201320722062205220422032202220122071206120512041203120212011207020602050204020302020771067105710471037102710171076106610561046103610261016107510651055104510351025101510741064105410441034102410141073106310531043103310231013107210621052104210321022101210711061105110411031102110111070106010501040103010201010770067005700470037002700170076006600560046003600260016007500650055004500350025001500740064005400440034002400140073006300530043003300230013007200620052004200320022001200710061005100410031002100110070006000500040003000200010000", "01234", "00", "000", "0000", "0554453433524232251413121150403020100", "00555454445534535434435334333552452352542442342532432332522422322255145135125154144134124153143133123152142132122151141131121115504503502501505404403402401405304303302301305204203202201205104103102101105004003002001000", "0006666565665565555666456646564556464665456546554555464545466445644654455446444544446663566346636563556345636463546344636366535653465365535553455364535453445363535366435643464365435543454364435443444363435343436633563346336533553345336433543344336333533343333666256624662366265625562456235626462546244623462636253624362336262665256524652365265525552455235526452545244523452635253524352335262525266425642464236426542554245423542644254424442344263425342434233426242524242663256324632363265325532453235326432543244323432633253324332333262325232423232662256224622362265225522452235226422542244223422632253224322332262225222422232222666156614661366126616561556145613561256164615461446134612461636153614361336123616261526142613261226161665156514651365126516551555145513551255164515451445134512451635153514351335123516251525142513251225161515166415641464136412641654155414541354125416441544144413441244163415341434133412341624152414241324122416141514141663156314631363126316531553145313531253164315431443134312431633153314331333123316231523142313231223161315131413131662156214621362126216521552145213521252164215421442134212421632153214321332123216221522142213221222161215121412131212166115611461136112611651155114511351125116411541144113411241163115311431133112311621152114211321122116111511141113111211116660566046603660266016606560556045603560256015606460546044603460246014606360536043603360236013606260526042603260226012606160516041603160216011606066505650465036502650165065505550455035502550155064505450445034502450145063505350435033502350135062505250425032502250125061505150415031502150115060505066405640464036402640164065405540454035402540154064405440444034402440144063405340434033402340134062405240424032402240124061405140414031402140114060405040406630563046303630263016306530553045303530253015306430543044303430243014306330533043303330233013306230523042303230223012306130513041303130213011306030503040303066205620462036202620162065205520452035202520152064205420442034202420142063205320432033202320132062205220422032202220122061205120412031202120112060205020402030202066105610461036102610161065105510451035102510151064105410441034102410141063105310431033102310131062105210421032102210121061105110411031102110111060105010401030102010106600560046003600260016006500550045003500250015006400540044003400240014006300530043003300230013006200520042003200220012006100510041003100210011006000500040003000200010000"], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "410", "slug": "create-maximum-number", "id": 410, "title": "Create Maximum Number", "difficulty": "Hard", "category": "array", "link": "https://leetcode.com/problems/create-maximum-number/", "examples": [{"explanation": "Take [6,5] from the first array and [9,8,3] from the second, interleaved as 9,8,6,5,3.", "input": "nums1 = [3,4,6,5], nums2 = [9,1,2,5,8,3], k = 5", "output": "[9,8,6,5,3]"}, {"explanation": "Using every digit of both arrays in order gives the only (hence best) length-5 number.", "input": "nums1 = [6,7], nums2 = [6,0,4], k = 5", "output": "[6,7,6,0,4]"}, {"explanation": "Keeping 9 from the first array and 8,9 from the second yields 9,8,9, the maximum.", "input": "nums1 = [3,9], nums2 = [8,9], k = 3", "output": "[9,8,9]"}], "hints": ["Try every split of k into i digits from nums1 and k-i from nums2.", "The best i-length subsequence of one array comes from a monotonic stack that drops smaller digits while enough remain.", "Merging two subsequences greedily by lexicographic suffix comparison yields the best interleave."], "statement": "You are given two arrays `nums1` and `nums2` of digits (each entry `0`\u2013`9`, with lengths `m` and `n`) plus an integer `k` with `1 <= k <= m + n`. Build the largest possible number with exactly `k` digits by picking some digits from each array so that the digits taken from either array keep their original relative order.\n\nDigits from the two arrays may be interleaved freely. Compare candidate numbers digit by digit from the most significant side (all have length `k`). Return the winning digits as an array.\n\n**Constraints:**\n- `m == nums1.length`, `n == nums2.length`\n- `1 <= m, n <= 500`\n- `0 <= nums1[i], nums2[i] <= 9`\n- `1 <= k <= m + n`\n", "solution": "## Approach\n\nFor every feasible split of `k` into `i` digits from the first array and `k - i` from the second, extract the best subsequence of the required length from each array with a monotonic stack, then greedily merge the two subsequences by comparing remaining suffixes. The maximum over all splits is the answer.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(k * (m + n + k^2)) in the worst case, with m and n up to 500.\n- **Space Complexity:** O(k) besides the inputs.\n\n## Implementation\n\n```python\nfrom typing import List\nclass Solution:\n def maxNumber(self, nums1: List[int], nums2: List[int], k: int) -> List[int]:\n def max_subseq(nums, t):\n drop = len(nums) - t\n st = []\n for v in nums:\n while st and drop and st[-1] < v:\n st.pop()\n drop -= 1\n if len(st) < t:\n st.append(v)\n else:\n drop -= 1\n return st\n\n def greater(a, i, b, j):\n while i < len(a) and j < len(b) and a[i] == b[j]:\n i += 1\n j += 1\n if j == len(b):\n return True\n if i == len(a):\n return False\n return a[i] > b[j]\n\n def merge(a, b):\n i = j = 0\n res = []\n while i < len(a) or j < len(b):\n if greater(a, i, b, j):\n res.append(a[i])\n i += 1\n else:\n res.append(b[j])\n j += 1\n return res\n\n best = []\n for i in range(max(0, k - len(nums2)), min(k, len(nums1)) + 1):\n cand = merge(max_subseq(nums1, i), max_subseq(nums2, k - i))\n if greater(cand, 0, best, 0):\n best = cand\n return best\n```\n", "starter": {"go": "package main\n\nfunc MaxNumber(nums1 []int, nums2 []int, k int) []int {\n \n}", "python": "from typing import List\nclass Solution:\n def maxNumber(self, nums1: List[int], nums2: List[int], k: int) -> List[int]:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {\n return {};\n }\n};"}, "fn": "maxNumber", "params": [{"name": "nums1", "type": "int_array"}, {"name": "nums2", "type": "int_array"}, {"name": "k", "type": "int"}], "outputType": "int_array", "tests": [["[3,4,6,5]", "[9,1,2,5,8,3]", "5"], ["[6,7]", "[6,0,4]", "5"], ["[3,9]", "[8,9]", "3"], ["[1]", "[2]", "1"], ["[1]", "[2]", "2"], ["[0]", "[0]", "1"], ["[5,1]", "[4,2]", "2"], ["[9,9,9]", "[9,9,9]", "3"], ["[1,2,3]", "[4,5,6]", "3"], ["[1,2,3]", "[4,5,6]", "6"], ["[6,6,6]", "[6,6,6]", "4"], ["[2,5,6,4,4,0]", "[7,3,8,0,6,5,7,4]", "4"], ["[1,1,1,1]", "[9,9,9,9]", "4"], ["[0,0,0]", "[1,0,0]", "2"], ["[8,6,4]", "[9,7,5]", "3"], ["[3,4,8,5]", "[9,1,2,5,8,3]", "5"], ["[1,2]", "[1,2]", "2"], ["[9,1]", "[2,8]", "3"], ["[5]", "[1,2,3,4]", "3"], ["[4,3,2,1]", "[9,8,7,6]", "4"], ["[0,1,0]", "[0,0,1]", "3"], ["[7,7,1,9]", "[7,7,9,1]", "5"], ["[9,8,7]", "[1,2,3]", "1"], ["[1,3,5]", "[2,4,6]", "4"], ["[6,7,5]", "[4,8,1]", "3"], ["[2,1,7,9]", "[3,6,5,8]", "6"], ["[5,4,3,2,1]", "[5,4,3,2,1]", "5"], ["[1,0,0,0]", "[9]", "2"], ["[8,9]", "[3,9]", "3"], ["[4,9,1]", "[4,9,1]", "4"]], "expected": [[9, 8, 6, 5, 3], [6, 7, 6, 0, 4], [9, 8, 9], [2], [2, 1], [0], [5, 4], [9, 9, 9], [6, 2, 3], [4, 5, 6, 1, 2, 3], [6, 6, 6, 6], [8, 7, 6, 4], [9, 9, 9, 9], [1, 0], [9, 8, 7], [9, 8, 8, 5, 3], [2, 2], [9, 8, 1], [5, 3, 4], [9, 8, 7, 6], [1, 1, 0], [9, 7, 7, 9, 1], [9], [6, 1, 3, 5], [8, 7, 5], [7, 9, 3, 6, 5, 8], [5, 5, 4, 4, 3], [9, 1], [9, 8, 9], [9, 9, 1, 1]], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "789", "slug": "custom-sort-string", "id": 789, "title": "Custom Sort String", "difficulty": "Medium", "category": "string", "link": "https://leetcode.com/problems/custom-sort-string/", "examples": [{"input": "order = \"cba\", s = \"abcd\"", "output": "\"cbad\"", "explanation": "Ranked letters c, b, a lead; leftover d trails."}, {"input": "order = \"bcafg\", s = \"abcd\"", "output": "\"bcad\"", "explanation": "Ranked prefix b, c, a with unranked d at the end."}, {"input": "order = \"kqep\", s = \"pekeq\"", "output": "\"kqeep\"", "explanation": "Characters reshuffled by rank k < q < e < p."}], "hints": ["Count how often each letter of s occurs.", "Emit letters following the order string first, repeating by their counts.", "Append any letters missing from order in any order at the end."], "statement": "You receive a helper string `order` that lists distinct lower-case letters\nin a custom priority sequence, plus a second string `s` to rearrange. Shrink\nor expand nothing: the output must be a permutation of `s` holding exactly\nthe same multiset of characters.\n\nThe rule: whenever a letter `x` appears earlier than a letter `y` inside\n`order`, every copy of `x` in your answer must stand before every copy of\n`y`. Letters of `s` that never occur in `order` may appear in any trailing\npositions, in any order among themselves.\n\nAny permutation meeting those conditions is accepted.\n\n**Constraints:**\n- `1 <= order.length <= 26`\n- `1 <= s.length <= 200`\n- `order` and `s` hold only lower-case English letters.\n- All characters of `order` are unique.\n", "solution": "## Approach\n\nTally how many times each letter of `s` appears. Walk through `order` from\nfirst to last, emitting each ranked letter as many times as it was counted.\nFinally emit the leftover letters that never appeared in `order`. Ranked\nblocks automatically respect the required precedence, and the multiset is\npreserved.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(|order| + |s|) for counting and rebuilding.\n- **Space Complexity:** O(1) extra besides the output (a fixed 26-slot table).\n\n## Implementation\n\n```python\nclass Solution:\n def customSortString(self, order: str, s: str) -> str:\n count = [0] * 26\n for c in s:\n count[ord(c) - 97] += 1\n parts: list[str] = []\n for c in order:\n parts.append(c * count[ord(c) - 97])\n count[ord(c) - 97] = 0\n for i in range(26):\n if count[i]:\n parts.append(chr(i + 97) * count[i])\n return \"\".join(parts)\n```\n", "starter": {"go": "package main\n\nfunc CustomSortString(order string, s string) string {\n return \"\"\n}", "python": "class Solution:\n def customSortString(self, order: str, s: str) -> str:\n return \"\"\n", "cpp": "#include <string>\nusing namespace std;\nclass Solution {\npublic:\n string customSortString(string order, string s) {\n return \"\";\n }\n};"}, "fn": "customSortString", "params": [{"name": "order", "type": "string"}, {"name": "s", "type": "string"}], "outputType": "string", "tests": [["cba", "abcd"], ["bcafg", "abcd"], ["kqep", "pekeq"], ["a", "a"], ["a", "b"], ["ab", "ba"], ["ba", "ab"], ["cba", "aabbcc"], ["xyz", "abc"], ["abcdefghijklmnopqrstuvwxyz", "zyxwvutsrqponmlkjihgfedcba"], ["zyxwvutsrqponmlkjihgfedcba", "abcde"], ["qwertyuiopasdfghjklzxcvbnm", "hello"], ["c", "cccc"], ["d", "abc"], ["exv", "xwvee"], ["hucw", "utzoampdgkalexslxoqfk"], ["kqep", "geek"], ["abc", "aaabbbcccdddeee"], ["cba", "cccaaaabbbbdddd"], ["mnh", "mmmmnnnnhhhh"], ["z", "abcdefghijklmnopqrstuvwxyz"], ["cbafed", "aabbccddeeff"], ["gh", "hhgghghhgg"], ["p", "pppppp"], ["qw", "qqwweerrttyy"], ["jihgfedcba", "abcdefghij"], ["az", "zzzzzaaaaa"], ["mnbvcxzlkjhgfdsapoiuytrewq", "teststring"]], "expected": ["cbad", "bcad", "kqeep", "a", "b", "ab", "ba", "ccbbaa", "abc", "abcdefghijklmnopqrstuvwxyz", "edcba", "eohll", "cccc", "abc", "eexvw", "uaadefgkkllmoopqstxxz", "keeg", "aaabbbcccdddeee", "cccbbbbaaaadddd", "mmmmnnnnhhhh", "zabcdefghijklmnopqrstuvwxy", "ccbbaaffeedd", "ggggghhhhh", "pppppp", "qqwweerrttyy", "jihgfedcba", "aaaaazzzzz", "ngssitttre"], "loose": false}
@@ -0,0 +1 @@
1
+ {"basic": false, "label": "694", "slug": "cut-off-trees-for-golf-event", "id": 694, "title": "Cut Off Trees for Golf Event", "difficulty": "Hard", "category": "matrix", "link": "https://leetcode.com/problems/cut-off-trees-for-golf-event/", "examples": [{"input": "forest = [[1,2,3],[0,0,4],[7,6,5]]", "output": "6", "explanation": "Visit heights 2,3,4,5,6,7 in order; the shortest walk uses 6 steps."}, {"input": "forest = [[1,2,3],[0,0,0],[7,6,5]]", "output": "-1", "explanation": "The middle wall disconnects the lower trees, so the tour is impossible."}, {"input": "forest = [[2,3,4],[0,0,5],[8,7,6]]", "output": "6", "explanation": "Start on height 2, then walk to 3,4,5,6,7,8 with 6 moves."}], "hints": ["Collect every cell above 1 and sort those trees by height; that is the visiting order.", "Between consecutive targets run breadth-first search avoiding 0 cells.", "Adaptation note: forest grids use int_array_2d where 0 blocks, 1 is open ground, and values above 1 are tree heights to cut in ascending order."], "statement": "You are given a rectangular grid `forest` of integers. Adaptation note: the grid is passed as `int_array_2d`.\n\n- `0` means a blocked cell that cannot be entered,\n- `1` means walkable ground with no tree,\n- any value above `1` means a tree whose height equals that value.\n\nStart at the top-left cell `(0,0)`. Repeatedly walk to the nearest remaining tree with the smallest height (using 4-directional moves through non-blocked cells), cut it (it becomes walkable), and continue. The walk length between trees is the shortest path distance.\n\nReturn the total number of steps over the whole tour, or `-1` when some tree cannot be reached. When no tree above height 1 exists, the total is `0`.\n\n**Constraints:**\n- `1 <= forest.length, forest[0].length <= 50`\n- `0 <= forest[i][j] <= 10^9`\n", "solution": "## Approach\n\nGather all trees (values above 1) and sort them by height to fix the cutting order. Starting from (0,0), run breadth-first search to each target in turn, skipping blocked zeros. Accumulate the distances; if any search fails, return -1.\n\n## Complexity Analysis\n\n- **Time Complexity:** O(T * m * n) where T is the tree count, for one BFS per tree.\n- **Space Complexity:** O(m * n) for the visited set and queue.\n\n## Implementation\n\n```python\nfrom typing import List\nfrom collections import deque\nclass Solution:\n def cutOffTree(self, forest: List[List[int]]) -> int:\n m, n = len(forest), len(forest[0])\n trees = sorted([(forest[i][j], i, j) for i in range(m) for j in range(n) if forest[i][j] > 1])\n def bfs(sr, sc, tr, tc):\n if sr == tr and sc == tc:\n return 0\n vis = [[False]*n for _ in range(m)]\n q = deque([(sr, sc)])\n vis[sr][sc] = True\n dist = 0\n while q:\n dist += 1\n for _ in range(len(q)):\n r, c = q.popleft()\n for dr, dc in ((1,0),(-1,0),(0,1),(0,-1)):\n nr, nc = r+dr, c+dc\n if 0 <= nr < m and 0 <= nc < n and not vis[nr][nc] and forest[nr][nc] != 0:\n if nr == tr and nc == tc:\n return dist\n vis[nr][nc] = True\n q.append((nr, nc))\n return -1\n sr = sc = total = 0\n for _, tr, tc in trees:\n d = bfs(sr, sc, tr, tc)\n if d < 0:\n return -1\n total += d\n sr, sc = tr, tc\n return total\n```\n", "starter": {"go": "package main\n\nfunc CutOffTree(forest [][]int) int {\n return 0\n}", "python": "from typing import List\nclass Solution:\n def cutOffTree(self, forest: List[List[int]]) -> int:\n pass", "cpp": "#include <vector>\nusing namespace std;\nclass Solution {\npublic:\n int cutOffTree(vector<vector<int>>& forest) {\n return 0;\n }\n};"}, "fn": "cutOffTree", "params": [{"name": "forest", "type": "int_array_2d", "visualizeType": "matrix"}], "outputType": "int", "tests": [["[[1,2,3],[0,0,4],[7,6,5]]"], ["[[1,2,3],[0,0,0],[7,6,5]]"], ["[[2,3,4],[0,0,5],[8,7,6]]"], ["[[1]]"], ["[[0]]"], ["[[2]]"], ["[[1,1],[1,1]]"], ["[[1,0],[0,1]]"], ["[[0,1],[1,1]]"], ["[[1,2],[3,4]]"], ["[[4,2,3],[0,0,1],[7,6,5]]"], ["[[1,2,3],[0,0,4],[8,7,6]]"], ["[[1,2],[0,3]]"], ["[[3,2,1]]"], ["[[1],[2],[3]]"], ["[[5,4,3],[0,1,2],[7,8,9]]"], ["[[1,1,1],[1,0,1],[1,1,2]]"], ["[[2,1],[1,1]]"], ["[[1,2,3,4],[0,0,0,5],[8,7,6,5]]"], ["[[1,0,2]]"], ["[[1,2],[2,1]]"], ["[[10,20],[30,40]]"], ["[[1,3,2]]"], ["[[2,3],[4,5]]"], ["[[1,1,2],[1,1,3],[1,1,4]]"], ["[[7,6,5],[0,0,4],[1,2,3]]"], ["[[1,2,3],[4,5,6],[7,8,9]]"], ["[[9,8,7],[6,5,4],[3,2,1]]"]], "expected": [6, -1, 6, 0, 0, 0, 0, 0, 0, 4, 10, 6, 2, 2, 2, 12, 4, 0, 8, -1, 3, 4, 3, 4, 4, 10, 12, 14], "loose": false}