From 333866d1bcfcc4edb0c02c8facb75605e01cc924 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 2 Jun 2023 17:19:02 +0200 Subject: [PATCH] chore: split solutions by language Signed-off-by: Matej Focko --- problems/{ => cpp}/boats-to-save-people.cpp | 0 problems/{ => cpp}/can-place-flowers.cpp | 0 problems/{ => cpp}/count-good-nodes-in-binary-tree.cpp | 0 problems/{ => cpp}/count-ways-to-build-good-strings.cpp | 0 problems/{ => cpp}/design-parking-system.cpp | 0 problems/{ => cpp}/determine-if-two-strings-are-close.cpp | 0 .../{ => cpp}/divide-a-string-into-groups-of-size-k.cpp | 0 .../{ => cpp}/kth-smallest-element-in-a-sorted-matrix.cpp | 0 problems/{ => cpp}/matrix-diagonal-sum.cpp | 0 .../{ => cpp}/max-sum-of-rectangle-no-larger-than-k.cpp | 0 problems/{ => cpp}/maximum-running-time-of-n-computers.cpp | 0 problems/{ => cpp}/merge-strings-alternately.cpp | 0 problems/{ => cpp}/middle-of-the-linked-list.cpp | 0 problems/{ => cpp}/minimum-moves-to-reach-target-score.cpp | 0 problems/{ => cpp}/mirror-reflection.cpp | 0 problems/{ => cpp}/my-calendar-i.cpp | 0 problems/{ => cpp}/n-ary-tree-level-order-traversal.cpp | 0 problems/{ => cpp}/n-ary-tree-preorder-traversal.cpp | 0 problems/{ => cpp}/number-of-matching-subsequences.cpp | 0 .../{ => cpp}/numbers-with-same-consecutive-differences.cpp | 0 problems/{ => cpp}/out-of-boundary-paths.cpp | 0 problems/{ => cpp}/palindrome-linked-list.cpp | 2 +- problems/{ => cpp}/partition-list.cpp | 0 problems/{ => cpp}/pascals-triangle-ii.cpp | 0 problems/{ => cpp}/pascals-triangle.cpp | 0 problems/{ => cpp}/ransom-note.cpp | 0 problems/{ => cpp}/removing-stars-from-a-string.cpp | 0 problems/{ => cpp}/reordered-power-of-2.cpp | 0 problems/{ => cpp}/rotate-image.cpp | 0 problems/{ => cpp}/same-tree.cpp | 0 problems/{ => cpp}/solving-questions-with-brainpower.cpp | 0 problems/{ => cpp}/sort-the-matrix-diagonally.cpp | 0 problems/{ => cpp}/spiral-matrix-ii.cpp | 0 problems/{ => cpp}/spiral-matrix.cpp | 0 problems/{ => cpp}/unique-paths.cpp | 0 problems/{ => cpp}/utf-8-validation.cpp | 0 problems/{ => cpp}/valid-parentheses.cpp | 0 .../{ => cpp}/vertical-order-traversal-of-a-binary-tree.cpp | 0 problems/{ => cs}/average-of-levels-in-binary-tree.cs | 0 problems/{ => cs}/binary-tree-pruning.cs | 0 problems/{ => cs}/poor-pigs.cs | 0 problems/{ => java}/binary-search-tree-iterator.java | 0 problems/{ => java}/combination-sum-iv.java | 0 .../convert-sorted-array-to-binary-search-tree.java | 0 problems/{ => java}/flatten-nested-list-iterator.java | 0 problems/{ => java}/n-ary-tree-level-order-traversal.java | 0 problems/{ => java}/peeking-iterator.java | 0 problems/{ => java}/rle-iterator.java | 0 problems/{ => js}/allow-one-function-call.js | 0 .../{ => js}/apply-transform-over-each-element-in-array.js | 0 problems/{ => js}/array-reduce-transformation.js | 0 problems/{ => js}/cache-with-time-limit.js | 0 problems/{ => js}/counter-ii.js | 0 problems/{ => js}/counter.js | 0 problems/{ => js}/create-hello-world-function.js | 0 problems/{ => js}/curry.js | 0 problems/{ => js}/debounce.js | 0 problems/{ => js}/filter-elements-from-array.js | 0 problems/{ => js}/function-composition.js | 0 problems/{ => js}/memoize.js | 0 problems/{ => js}/promise-pool.js | 0 problems/{ => js}/promise-time-limit.js | 0 problems/{ => js}/sleep.js | 0 problems/{ => js}/throttle.js | 0 problems/{ => kt}/binary-tree-inorder-traversal.kt | 0 problems/{ => kt}/binary-tree-level-order-traversal.kt | 6 +++--- .../check-if-every-row-and-column-contains-all-numbers.kt | 0 problems/{ => kt}/construct-string-from-binary-tree.kt | 0 problems/{ => kt}/first-unique-character-in-a-string.kt | 0 problems/{ => kt}/iterator-for-combination.kt | 0 .../lowest-common-ancestor-of-a-binary-search-tree.kt | 0 problems/{ => kt}/max-area-of-island.kt | 0 problems/{ => kt}/maximize-distance-to-closest-person.kt | 0 problems/{ => kt}/maximum-units-on-a-truck.kt | 0 problems/{ => kt}/minimum-number-of-refueling-stops.kt | 0 problems/{ => kt}/power-of-three.kt | 0 problems/{ => kt}/roman-to-integer.kt | 0 .../{ => kt}/split-array-into-consecutive-subsequences.kt | 0 .../{ => kt}/substring-with-concatenation-of-all-words.kt | 0 problems/{ => kt}/unique-morse-code-words.kt | 0 problems/{ => kt}/validate-binary-search-tree.kt | 0 problems/{ => kt}/word-ladder-ii.kt | 0 problems/{ => rb}/binary-search.rb | 0 problems/{ => rb}/climbing-stairs.rb | 0 problems/{ => rb}/contains-duplicate.rb | 0 problems/{ => rb}/fibonacci-number.rb | 0 problems/{ => rb}/first-bad-version.rb | 0 problems/{ => rb}/insert-into-a-binary-search-tree.rb | 0 problems/{ => rb}/linked-list-cycle-ii.rb | 0 problems/{ => rb}/maximum-subarray.rb | 0 problems/{ => rb}/merge-sorted-array.rb | 0 problems/{ => rb}/min-cost-climbing-stairs.rb | 0 problems/{ => rb}/rotate-array.rb | 0 problems/{ => rb}/search-insert-position.rb | 0 problems/{ => rb}/squares-of-a-sorted-array.rb | 0 problems/{ => rb}/tribonacci.rb | 0 problems/{ => rb}/two-sum.rb | 0 problems/{ => rb}/word-pattern.rb | 0 problems/{ => rs}/add-digits.rs | 0 problems/{ => rs}/best-time-to-buy-and-sell-stock-iv.rs | 0 problems/{ => rs}/binary-tree-inorder-traversal.rs | 0 problems/{ => rs}/binary-trees-with-factors.rs | 0 problems/{ => rs}/complex-number-multiplication.rs | 0 problems/{ => rs}/count-vowels-permutation.rs | 0 problems/{ => rs}/find-pivot-index.rs | 0 ...nd-the-longest-valid-obstacle-course-at-each-position.rs | 0 problems/{ => rs}/is-graph-bipartite.rs | 0 .../{ => rs}/kids-with-the-greatest-number-of-candies.rs | 0 problems/{ => rs}/longest-increasing-subsequence.rs | 0 problems/{ => rs}/longest-palindromic-subsequence.rs | 0 problems/{ => rs}/maximum-number-of-coins-you-can-get.rs | 0 problems/{ => rs}/maximum-value-of-k-coins-from-piles.rs | 0 .../minimum-number-of-vertices-to-reach-all-nodes.rs | 0 problems/{ => rs}/number-of-islands.rs | 0 problems/{ => rs}/pacific-atlantic-water-flow.rs | 0 problems/{ => rs}/power-of-four.rs | 0 problems/{ => rs}/range-sum-query-immutable.rs | 0 problems/{ => rs}/reduce-array-size-to-the-half.rs | 0 problems/{ => rs}/running-sum-of-1d-array.rs | 0 problems/{ => rs}/shortest-path-in-binary-matrix.rs | 0 problems/{ => rs}/simplify-path.rs | 0 problems/{ => rs}/smallest-number-in-infinite-set.rs | 0 problems/{ => rs}/solving-questions-with-brainpower.rs | 0 problems/{ => rs}/sort-characters-by-frequency.rs | 0 problems/{ => rs}/stamping-the-sequence.rs | 0 .../{ => rs}/the-number-of-weak-characters-in-the-game.rs | 0 problems/{ => rs}/validate-stack-sequences.rs | 0 problems/{ => swift}/contains-duplicate.swift | 0 problems/{ => swift}/number-complement.swift | 0 problems/{ => swift}/two-sum.swift | 0 problems/{ => swift}/valid-parentheses.swift | 0 131 files changed, 4 insertions(+), 4 deletions(-) rename problems/{ => cpp}/boats-to-save-people.cpp (100%) rename problems/{ => cpp}/can-place-flowers.cpp (100%) rename problems/{ => cpp}/count-good-nodes-in-binary-tree.cpp (100%) rename problems/{ => cpp}/count-ways-to-build-good-strings.cpp (100%) rename problems/{ => cpp}/design-parking-system.cpp (100%) rename problems/{ => cpp}/determine-if-two-strings-are-close.cpp (100%) rename problems/{ => cpp}/divide-a-string-into-groups-of-size-k.cpp (100%) rename problems/{ => cpp}/kth-smallest-element-in-a-sorted-matrix.cpp (100%) rename problems/{ => cpp}/matrix-diagonal-sum.cpp (100%) rename problems/{ => cpp}/max-sum-of-rectangle-no-larger-than-k.cpp (100%) rename problems/{ => cpp}/maximum-running-time-of-n-computers.cpp (100%) rename problems/{ => cpp}/merge-strings-alternately.cpp (100%) rename problems/{ => cpp}/middle-of-the-linked-list.cpp (100%) rename problems/{ => cpp}/minimum-moves-to-reach-target-score.cpp (100%) rename problems/{ => cpp}/mirror-reflection.cpp (100%) rename problems/{ => cpp}/my-calendar-i.cpp (100%) rename problems/{ => cpp}/n-ary-tree-level-order-traversal.cpp (100%) rename problems/{ => cpp}/n-ary-tree-preorder-traversal.cpp (100%) rename problems/{ => cpp}/number-of-matching-subsequences.cpp (100%) rename problems/{ => cpp}/numbers-with-same-consecutive-differences.cpp (100%) rename problems/{ => cpp}/out-of-boundary-paths.cpp (100%) rename problems/{ => cpp}/palindrome-linked-list.cpp (99%) rename problems/{ => cpp}/partition-list.cpp (100%) rename problems/{ => cpp}/pascals-triangle-ii.cpp (100%) rename problems/{ => cpp}/pascals-triangle.cpp (100%) rename problems/{ => cpp}/ransom-note.cpp (100%) rename problems/{ => cpp}/removing-stars-from-a-string.cpp (100%) rename problems/{ => cpp}/reordered-power-of-2.cpp (100%) rename problems/{ => cpp}/rotate-image.cpp (100%) rename problems/{ => cpp}/same-tree.cpp (100%) rename problems/{ => cpp}/solving-questions-with-brainpower.cpp (100%) rename problems/{ => cpp}/sort-the-matrix-diagonally.cpp (100%) rename problems/{ => cpp}/spiral-matrix-ii.cpp (100%) rename problems/{ => cpp}/spiral-matrix.cpp (100%) rename problems/{ => cpp}/unique-paths.cpp (100%) rename problems/{ => cpp}/utf-8-validation.cpp (100%) rename problems/{ => cpp}/valid-parentheses.cpp (100%) rename problems/{ => cpp}/vertical-order-traversal-of-a-binary-tree.cpp (100%) rename problems/{ => cs}/average-of-levels-in-binary-tree.cs (100%) rename problems/{ => cs}/binary-tree-pruning.cs (100%) rename problems/{ => cs}/poor-pigs.cs (100%) rename problems/{ => java}/binary-search-tree-iterator.java (100%) rename problems/{ => java}/combination-sum-iv.java (100%) rename problems/{ => java}/convert-sorted-array-to-binary-search-tree.java (100%) rename problems/{ => java}/flatten-nested-list-iterator.java (100%) rename problems/{ => java}/n-ary-tree-level-order-traversal.java (100%) rename problems/{ => java}/peeking-iterator.java (100%) rename problems/{ => java}/rle-iterator.java (100%) rename problems/{ => js}/allow-one-function-call.js (100%) rename problems/{ => js}/apply-transform-over-each-element-in-array.js (100%) rename problems/{ => js}/array-reduce-transformation.js (100%) rename problems/{ => js}/cache-with-time-limit.js (100%) rename problems/{ => js}/counter-ii.js (100%) rename problems/{ => js}/counter.js (100%) rename problems/{ => js}/create-hello-world-function.js (100%) rename problems/{ => js}/curry.js (100%) rename problems/{ => js}/debounce.js (100%) rename problems/{ => js}/filter-elements-from-array.js (100%) rename problems/{ => js}/function-composition.js (100%) rename problems/{ => js}/memoize.js (100%) rename problems/{ => js}/promise-pool.js (100%) rename problems/{ => js}/promise-time-limit.js (100%) rename problems/{ => js}/sleep.js (100%) rename problems/{ => js}/throttle.js (100%) rename problems/{ => kt}/binary-tree-inorder-traversal.kt (100%) rename problems/{ => kt}/binary-tree-level-order-traversal.kt (97%) rename problems/{ => kt}/check-if-every-row-and-column-contains-all-numbers.kt (100%) rename problems/{ => kt}/construct-string-from-binary-tree.kt (100%) rename problems/{ => kt}/first-unique-character-in-a-string.kt (100%) rename problems/{ => kt}/iterator-for-combination.kt (100%) rename problems/{ => kt}/lowest-common-ancestor-of-a-binary-search-tree.kt (100%) rename problems/{ => kt}/max-area-of-island.kt (100%) rename problems/{ => kt}/maximize-distance-to-closest-person.kt (100%) rename problems/{ => kt}/maximum-units-on-a-truck.kt (100%) rename problems/{ => kt}/minimum-number-of-refueling-stops.kt (100%) rename problems/{ => kt}/power-of-three.kt (100%) rename problems/{ => kt}/roman-to-integer.kt (100%) rename problems/{ => kt}/split-array-into-consecutive-subsequences.kt (100%) rename problems/{ => kt}/substring-with-concatenation-of-all-words.kt (100%) rename problems/{ => kt}/unique-morse-code-words.kt (100%) rename problems/{ => kt}/validate-binary-search-tree.kt (100%) rename problems/{ => kt}/word-ladder-ii.kt (100%) rename problems/{ => rb}/binary-search.rb (100%) rename problems/{ => rb}/climbing-stairs.rb (100%) rename problems/{ => rb}/contains-duplicate.rb (100%) rename problems/{ => rb}/fibonacci-number.rb (100%) rename problems/{ => rb}/first-bad-version.rb (100%) rename problems/{ => rb}/insert-into-a-binary-search-tree.rb (100%) rename problems/{ => rb}/linked-list-cycle-ii.rb (100%) rename problems/{ => rb}/maximum-subarray.rb (100%) rename problems/{ => rb}/merge-sorted-array.rb (100%) rename problems/{ => rb}/min-cost-climbing-stairs.rb (100%) rename problems/{ => rb}/rotate-array.rb (100%) rename problems/{ => rb}/search-insert-position.rb (100%) rename problems/{ => rb}/squares-of-a-sorted-array.rb (100%) rename problems/{ => rb}/tribonacci.rb (100%) rename problems/{ => rb}/two-sum.rb (100%) rename problems/{ => rb}/word-pattern.rb (100%) rename problems/{ => rs}/add-digits.rs (100%) rename problems/{ => rs}/best-time-to-buy-and-sell-stock-iv.rs (100%) rename problems/{ => rs}/binary-tree-inorder-traversal.rs (100%) rename problems/{ => rs}/binary-trees-with-factors.rs (100%) rename problems/{ => rs}/complex-number-multiplication.rs (100%) rename problems/{ => rs}/count-vowels-permutation.rs (100%) rename problems/{ => rs}/find-pivot-index.rs (100%) rename problems/{ => rs}/find-the-longest-valid-obstacle-course-at-each-position.rs (100%) rename problems/{ => rs}/is-graph-bipartite.rs (100%) rename problems/{ => rs}/kids-with-the-greatest-number-of-candies.rs (100%) rename problems/{ => rs}/longest-increasing-subsequence.rs (100%) rename problems/{ => rs}/longest-palindromic-subsequence.rs (100%) rename problems/{ => rs}/maximum-number-of-coins-you-can-get.rs (100%) rename problems/{ => rs}/maximum-value-of-k-coins-from-piles.rs (100%) rename problems/{ => rs}/minimum-number-of-vertices-to-reach-all-nodes.rs (100%) rename problems/{ => rs}/number-of-islands.rs (100%) rename problems/{ => rs}/pacific-atlantic-water-flow.rs (100%) rename problems/{ => rs}/power-of-four.rs (100%) rename problems/{ => rs}/range-sum-query-immutable.rs (100%) rename problems/{ => rs}/reduce-array-size-to-the-half.rs (100%) rename problems/{ => rs}/running-sum-of-1d-array.rs (100%) rename problems/{ => rs}/shortest-path-in-binary-matrix.rs (100%) rename problems/{ => rs}/simplify-path.rs (100%) rename problems/{ => rs}/smallest-number-in-infinite-set.rs (100%) rename problems/{ => rs}/solving-questions-with-brainpower.rs (100%) rename problems/{ => rs}/sort-characters-by-frequency.rs (100%) rename problems/{ => rs}/stamping-the-sequence.rs (100%) rename problems/{ => rs}/the-number-of-weak-characters-in-the-game.rs (100%) rename problems/{ => rs}/validate-stack-sequences.rs (100%) rename problems/{ => swift}/contains-duplicate.swift (100%) rename problems/{ => swift}/number-complement.swift (100%) rename problems/{ => swift}/two-sum.swift (100%) rename problems/{ => swift}/valid-parentheses.swift (100%) diff --git a/problems/boats-to-save-people.cpp b/problems/cpp/boats-to-save-people.cpp similarity index 100% rename from problems/boats-to-save-people.cpp rename to problems/cpp/boats-to-save-people.cpp diff --git a/problems/can-place-flowers.cpp b/problems/cpp/can-place-flowers.cpp similarity index 100% rename from problems/can-place-flowers.cpp rename to problems/cpp/can-place-flowers.cpp diff --git a/problems/count-good-nodes-in-binary-tree.cpp b/problems/cpp/count-good-nodes-in-binary-tree.cpp similarity index 100% rename from problems/count-good-nodes-in-binary-tree.cpp rename to problems/cpp/count-good-nodes-in-binary-tree.cpp diff --git a/problems/count-ways-to-build-good-strings.cpp b/problems/cpp/count-ways-to-build-good-strings.cpp similarity index 100% rename from problems/count-ways-to-build-good-strings.cpp rename to problems/cpp/count-ways-to-build-good-strings.cpp diff --git a/problems/design-parking-system.cpp b/problems/cpp/design-parking-system.cpp similarity index 100% rename from problems/design-parking-system.cpp rename to problems/cpp/design-parking-system.cpp diff --git a/problems/determine-if-two-strings-are-close.cpp b/problems/cpp/determine-if-two-strings-are-close.cpp similarity index 100% rename from problems/determine-if-two-strings-are-close.cpp rename to problems/cpp/determine-if-two-strings-are-close.cpp diff --git a/problems/divide-a-string-into-groups-of-size-k.cpp b/problems/cpp/divide-a-string-into-groups-of-size-k.cpp similarity index 100% rename from problems/divide-a-string-into-groups-of-size-k.cpp rename to problems/cpp/divide-a-string-into-groups-of-size-k.cpp diff --git a/problems/kth-smallest-element-in-a-sorted-matrix.cpp b/problems/cpp/kth-smallest-element-in-a-sorted-matrix.cpp similarity index 100% rename from problems/kth-smallest-element-in-a-sorted-matrix.cpp rename to problems/cpp/kth-smallest-element-in-a-sorted-matrix.cpp diff --git a/problems/matrix-diagonal-sum.cpp b/problems/cpp/matrix-diagonal-sum.cpp similarity index 100% rename from problems/matrix-diagonal-sum.cpp rename to problems/cpp/matrix-diagonal-sum.cpp diff --git a/problems/max-sum-of-rectangle-no-larger-than-k.cpp b/problems/cpp/max-sum-of-rectangle-no-larger-than-k.cpp similarity index 100% rename from problems/max-sum-of-rectangle-no-larger-than-k.cpp rename to problems/cpp/max-sum-of-rectangle-no-larger-than-k.cpp diff --git a/problems/maximum-running-time-of-n-computers.cpp b/problems/cpp/maximum-running-time-of-n-computers.cpp similarity index 100% rename from problems/maximum-running-time-of-n-computers.cpp rename to problems/cpp/maximum-running-time-of-n-computers.cpp diff --git a/problems/merge-strings-alternately.cpp b/problems/cpp/merge-strings-alternately.cpp similarity index 100% rename from problems/merge-strings-alternately.cpp rename to problems/cpp/merge-strings-alternately.cpp diff --git a/problems/middle-of-the-linked-list.cpp b/problems/cpp/middle-of-the-linked-list.cpp similarity index 100% rename from problems/middle-of-the-linked-list.cpp rename to problems/cpp/middle-of-the-linked-list.cpp diff --git a/problems/minimum-moves-to-reach-target-score.cpp b/problems/cpp/minimum-moves-to-reach-target-score.cpp similarity index 100% rename from problems/minimum-moves-to-reach-target-score.cpp rename to problems/cpp/minimum-moves-to-reach-target-score.cpp diff --git a/problems/mirror-reflection.cpp b/problems/cpp/mirror-reflection.cpp similarity index 100% rename from problems/mirror-reflection.cpp rename to problems/cpp/mirror-reflection.cpp diff --git a/problems/my-calendar-i.cpp b/problems/cpp/my-calendar-i.cpp similarity index 100% rename from problems/my-calendar-i.cpp rename to problems/cpp/my-calendar-i.cpp diff --git a/problems/n-ary-tree-level-order-traversal.cpp b/problems/cpp/n-ary-tree-level-order-traversal.cpp similarity index 100% rename from problems/n-ary-tree-level-order-traversal.cpp rename to problems/cpp/n-ary-tree-level-order-traversal.cpp diff --git a/problems/n-ary-tree-preorder-traversal.cpp b/problems/cpp/n-ary-tree-preorder-traversal.cpp similarity index 100% rename from problems/n-ary-tree-preorder-traversal.cpp rename to problems/cpp/n-ary-tree-preorder-traversal.cpp diff --git a/problems/number-of-matching-subsequences.cpp b/problems/cpp/number-of-matching-subsequences.cpp similarity index 100% rename from problems/number-of-matching-subsequences.cpp rename to problems/cpp/number-of-matching-subsequences.cpp diff --git a/problems/numbers-with-same-consecutive-differences.cpp b/problems/cpp/numbers-with-same-consecutive-differences.cpp similarity index 100% rename from problems/numbers-with-same-consecutive-differences.cpp rename to problems/cpp/numbers-with-same-consecutive-differences.cpp diff --git a/problems/out-of-boundary-paths.cpp b/problems/cpp/out-of-boundary-paths.cpp similarity index 100% rename from problems/out-of-boundary-paths.cpp rename to problems/cpp/out-of-boundary-paths.cpp diff --git a/problems/palindrome-linked-list.cpp b/problems/cpp/palindrome-linked-list.cpp similarity index 99% rename from problems/palindrome-linked-list.cpp rename to problems/cpp/palindrome-linked-list.cpp index 04f2314..c6ba84a 100644 --- a/problems/palindrome-linked-list.cpp +++ b/problems/cpp/palindrome-linked-list.cpp @@ -169,4 +169,4 @@ int main() assert(test_isPalindrome(std::vector { 1 })); return 0; -} \ No newline at end of file +} diff --git a/problems/partition-list.cpp b/problems/cpp/partition-list.cpp similarity index 100% rename from problems/partition-list.cpp rename to problems/cpp/partition-list.cpp diff --git a/problems/pascals-triangle-ii.cpp b/problems/cpp/pascals-triangle-ii.cpp similarity index 100% rename from problems/pascals-triangle-ii.cpp rename to problems/cpp/pascals-triangle-ii.cpp diff --git a/problems/pascals-triangle.cpp b/problems/cpp/pascals-triangle.cpp similarity index 100% rename from problems/pascals-triangle.cpp rename to problems/cpp/pascals-triangle.cpp diff --git a/problems/ransom-note.cpp b/problems/cpp/ransom-note.cpp similarity index 100% rename from problems/ransom-note.cpp rename to problems/cpp/ransom-note.cpp diff --git a/problems/removing-stars-from-a-string.cpp b/problems/cpp/removing-stars-from-a-string.cpp similarity index 100% rename from problems/removing-stars-from-a-string.cpp rename to problems/cpp/removing-stars-from-a-string.cpp diff --git a/problems/reordered-power-of-2.cpp b/problems/cpp/reordered-power-of-2.cpp similarity index 100% rename from problems/reordered-power-of-2.cpp rename to problems/cpp/reordered-power-of-2.cpp diff --git a/problems/rotate-image.cpp b/problems/cpp/rotate-image.cpp similarity index 100% rename from problems/rotate-image.cpp rename to problems/cpp/rotate-image.cpp diff --git a/problems/same-tree.cpp b/problems/cpp/same-tree.cpp similarity index 100% rename from problems/same-tree.cpp rename to problems/cpp/same-tree.cpp diff --git a/problems/solving-questions-with-brainpower.cpp b/problems/cpp/solving-questions-with-brainpower.cpp similarity index 100% rename from problems/solving-questions-with-brainpower.cpp rename to problems/cpp/solving-questions-with-brainpower.cpp diff --git a/problems/sort-the-matrix-diagonally.cpp b/problems/cpp/sort-the-matrix-diagonally.cpp similarity index 100% rename from problems/sort-the-matrix-diagonally.cpp rename to problems/cpp/sort-the-matrix-diagonally.cpp diff --git a/problems/spiral-matrix-ii.cpp b/problems/cpp/spiral-matrix-ii.cpp similarity index 100% rename from problems/spiral-matrix-ii.cpp rename to problems/cpp/spiral-matrix-ii.cpp diff --git a/problems/spiral-matrix.cpp b/problems/cpp/spiral-matrix.cpp similarity index 100% rename from problems/spiral-matrix.cpp rename to problems/cpp/spiral-matrix.cpp diff --git a/problems/unique-paths.cpp b/problems/cpp/unique-paths.cpp similarity index 100% rename from problems/unique-paths.cpp rename to problems/cpp/unique-paths.cpp diff --git a/problems/utf-8-validation.cpp b/problems/cpp/utf-8-validation.cpp similarity index 100% rename from problems/utf-8-validation.cpp rename to problems/cpp/utf-8-validation.cpp diff --git a/problems/valid-parentheses.cpp b/problems/cpp/valid-parentheses.cpp similarity index 100% rename from problems/valid-parentheses.cpp rename to problems/cpp/valid-parentheses.cpp diff --git a/problems/vertical-order-traversal-of-a-binary-tree.cpp b/problems/cpp/vertical-order-traversal-of-a-binary-tree.cpp similarity index 100% rename from problems/vertical-order-traversal-of-a-binary-tree.cpp rename to problems/cpp/vertical-order-traversal-of-a-binary-tree.cpp diff --git a/problems/average-of-levels-in-binary-tree.cs b/problems/cs/average-of-levels-in-binary-tree.cs similarity index 100% rename from problems/average-of-levels-in-binary-tree.cs rename to problems/cs/average-of-levels-in-binary-tree.cs diff --git a/problems/binary-tree-pruning.cs b/problems/cs/binary-tree-pruning.cs similarity index 100% rename from problems/binary-tree-pruning.cs rename to problems/cs/binary-tree-pruning.cs diff --git a/problems/poor-pigs.cs b/problems/cs/poor-pigs.cs similarity index 100% rename from problems/poor-pigs.cs rename to problems/cs/poor-pigs.cs diff --git a/problems/binary-search-tree-iterator.java b/problems/java/binary-search-tree-iterator.java similarity index 100% rename from problems/binary-search-tree-iterator.java rename to problems/java/binary-search-tree-iterator.java diff --git a/problems/combination-sum-iv.java b/problems/java/combination-sum-iv.java similarity index 100% rename from problems/combination-sum-iv.java rename to problems/java/combination-sum-iv.java diff --git a/problems/convert-sorted-array-to-binary-search-tree.java b/problems/java/convert-sorted-array-to-binary-search-tree.java similarity index 100% rename from problems/convert-sorted-array-to-binary-search-tree.java rename to problems/java/convert-sorted-array-to-binary-search-tree.java diff --git a/problems/flatten-nested-list-iterator.java b/problems/java/flatten-nested-list-iterator.java similarity index 100% rename from problems/flatten-nested-list-iterator.java rename to problems/java/flatten-nested-list-iterator.java diff --git a/problems/n-ary-tree-level-order-traversal.java b/problems/java/n-ary-tree-level-order-traversal.java similarity index 100% rename from problems/n-ary-tree-level-order-traversal.java rename to problems/java/n-ary-tree-level-order-traversal.java diff --git a/problems/peeking-iterator.java b/problems/java/peeking-iterator.java similarity index 100% rename from problems/peeking-iterator.java rename to problems/java/peeking-iterator.java diff --git a/problems/rle-iterator.java b/problems/java/rle-iterator.java similarity index 100% rename from problems/rle-iterator.java rename to problems/java/rle-iterator.java diff --git a/problems/allow-one-function-call.js b/problems/js/allow-one-function-call.js similarity index 100% rename from problems/allow-one-function-call.js rename to problems/js/allow-one-function-call.js diff --git a/problems/apply-transform-over-each-element-in-array.js b/problems/js/apply-transform-over-each-element-in-array.js similarity index 100% rename from problems/apply-transform-over-each-element-in-array.js rename to problems/js/apply-transform-over-each-element-in-array.js diff --git a/problems/array-reduce-transformation.js b/problems/js/array-reduce-transformation.js similarity index 100% rename from problems/array-reduce-transformation.js rename to problems/js/array-reduce-transformation.js diff --git a/problems/cache-with-time-limit.js b/problems/js/cache-with-time-limit.js similarity index 100% rename from problems/cache-with-time-limit.js rename to problems/js/cache-with-time-limit.js diff --git a/problems/counter-ii.js b/problems/js/counter-ii.js similarity index 100% rename from problems/counter-ii.js rename to problems/js/counter-ii.js diff --git a/problems/counter.js b/problems/js/counter.js similarity index 100% rename from problems/counter.js rename to problems/js/counter.js diff --git a/problems/create-hello-world-function.js b/problems/js/create-hello-world-function.js similarity index 100% rename from problems/create-hello-world-function.js rename to problems/js/create-hello-world-function.js diff --git a/problems/curry.js b/problems/js/curry.js similarity index 100% rename from problems/curry.js rename to problems/js/curry.js diff --git a/problems/debounce.js b/problems/js/debounce.js similarity index 100% rename from problems/debounce.js rename to problems/js/debounce.js diff --git a/problems/filter-elements-from-array.js b/problems/js/filter-elements-from-array.js similarity index 100% rename from problems/filter-elements-from-array.js rename to problems/js/filter-elements-from-array.js diff --git a/problems/function-composition.js b/problems/js/function-composition.js similarity index 100% rename from problems/function-composition.js rename to problems/js/function-composition.js diff --git a/problems/memoize.js b/problems/js/memoize.js similarity index 100% rename from problems/memoize.js rename to problems/js/memoize.js diff --git a/problems/promise-pool.js b/problems/js/promise-pool.js similarity index 100% rename from problems/promise-pool.js rename to problems/js/promise-pool.js diff --git a/problems/promise-time-limit.js b/problems/js/promise-time-limit.js similarity index 100% rename from problems/promise-time-limit.js rename to problems/js/promise-time-limit.js diff --git a/problems/sleep.js b/problems/js/sleep.js similarity index 100% rename from problems/sleep.js rename to problems/js/sleep.js diff --git a/problems/throttle.js b/problems/js/throttle.js similarity index 100% rename from problems/throttle.js rename to problems/js/throttle.js diff --git a/problems/binary-tree-inorder-traversal.kt b/problems/kt/binary-tree-inorder-traversal.kt similarity index 100% rename from problems/binary-tree-inorder-traversal.kt rename to problems/kt/binary-tree-inorder-traversal.kt diff --git a/problems/binary-tree-level-order-traversal.kt b/problems/kt/binary-tree-level-order-traversal.kt similarity index 97% rename from problems/binary-tree-level-order-traversal.kt rename to problems/kt/binary-tree-level-order-traversal.kt index 21ca888..f8e4680 100644 --- a/problems/binary-tree-level-order-traversal.kt +++ b/problems/kt/binary-tree-level-order-traversal.kt @@ -13,15 +13,15 @@ class Solution { if (root == null) { return levels } - + if (level + 1 > levels.size) { levels.add(mutableListOf()) } - + levels[level].add(root.`val`) levelOrder(root.left, levels, level + 1) return levelOrder(root.right, levels, level + 1) } - + fun levelOrder(root: TreeNode?): List> = levelOrder(root, mutableListOf>(), 0) } diff --git a/problems/check-if-every-row-and-column-contains-all-numbers.kt b/problems/kt/check-if-every-row-and-column-contains-all-numbers.kt similarity index 100% rename from problems/check-if-every-row-and-column-contains-all-numbers.kt rename to problems/kt/check-if-every-row-and-column-contains-all-numbers.kt diff --git a/problems/construct-string-from-binary-tree.kt b/problems/kt/construct-string-from-binary-tree.kt similarity index 100% rename from problems/construct-string-from-binary-tree.kt rename to problems/kt/construct-string-from-binary-tree.kt diff --git a/problems/first-unique-character-in-a-string.kt b/problems/kt/first-unique-character-in-a-string.kt similarity index 100% rename from problems/first-unique-character-in-a-string.kt rename to problems/kt/first-unique-character-in-a-string.kt diff --git a/problems/iterator-for-combination.kt b/problems/kt/iterator-for-combination.kt similarity index 100% rename from problems/iterator-for-combination.kt rename to problems/kt/iterator-for-combination.kt diff --git a/problems/lowest-common-ancestor-of-a-binary-search-tree.kt b/problems/kt/lowest-common-ancestor-of-a-binary-search-tree.kt similarity index 100% rename from problems/lowest-common-ancestor-of-a-binary-search-tree.kt rename to problems/kt/lowest-common-ancestor-of-a-binary-search-tree.kt diff --git a/problems/max-area-of-island.kt b/problems/kt/max-area-of-island.kt similarity index 100% rename from problems/max-area-of-island.kt rename to problems/kt/max-area-of-island.kt diff --git a/problems/maximize-distance-to-closest-person.kt b/problems/kt/maximize-distance-to-closest-person.kt similarity index 100% rename from problems/maximize-distance-to-closest-person.kt rename to problems/kt/maximize-distance-to-closest-person.kt diff --git a/problems/maximum-units-on-a-truck.kt b/problems/kt/maximum-units-on-a-truck.kt similarity index 100% rename from problems/maximum-units-on-a-truck.kt rename to problems/kt/maximum-units-on-a-truck.kt diff --git a/problems/minimum-number-of-refueling-stops.kt b/problems/kt/minimum-number-of-refueling-stops.kt similarity index 100% rename from problems/minimum-number-of-refueling-stops.kt rename to problems/kt/minimum-number-of-refueling-stops.kt diff --git a/problems/power-of-three.kt b/problems/kt/power-of-three.kt similarity index 100% rename from problems/power-of-three.kt rename to problems/kt/power-of-three.kt diff --git a/problems/roman-to-integer.kt b/problems/kt/roman-to-integer.kt similarity index 100% rename from problems/roman-to-integer.kt rename to problems/kt/roman-to-integer.kt diff --git a/problems/split-array-into-consecutive-subsequences.kt b/problems/kt/split-array-into-consecutive-subsequences.kt similarity index 100% rename from problems/split-array-into-consecutive-subsequences.kt rename to problems/kt/split-array-into-consecutive-subsequences.kt diff --git a/problems/substring-with-concatenation-of-all-words.kt b/problems/kt/substring-with-concatenation-of-all-words.kt similarity index 100% rename from problems/substring-with-concatenation-of-all-words.kt rename to problems/kt/substring-with-concatenation-of-all-words.kt diff --git a/problems/unique-morse-code-words.kt b/problems/kt/unique-morse-code-words.kt similarity index 100% rename from problems/unique-morse-code-words.kt rename to problems/kt/unique-morse-code-words.kt diff --git a/problems/validate-binary-search-tree.kt b/problems/kt/validate-binary-search-tree.kt similarity index 100% rename from problems/validate-binary-search-tree.kt rename to problems/kt/validate-binary-search-tree.kt diff --git a/problems/word-ladder-ii.kt b/problems/kt/word-ladder-ii.kt similarity index 100% rename from problems/word-ladder-ii.kt rename to problems/kt/word-ladder-ii.kt diff --git a/problems/binary-search.rb b/problems/rb/binary-search.rb similarity index 100% rename from problems/binary-search.rb rename to problems/rb/binary-search.rb diff --git a/problems/climbing-stairs.rb b/problems/rb/climbing-stairs.rb similarity index 100% rename from problems/climbing-stairs.rb rename to problems/rb/climbing-stairs.rb diff --git a/problems/contains-duplicate.rb b/problems/rb/contains-duplicate.rb similarity index 100% rename from problems/contains-duplicate.rb rename to problems/rb/contains-duplicate.rb diff --git a/problems/fibonacci-number.rb b/problems/rb/fibonacci-number.rb similarity index 100% rename from problems/fibonacci-number.rb rename to problems/rb/fibonacci-number.rb diff --git a/problems/first-bad-version.rb b/problems/rb/first-bad-version.rb similarity index 100% rename from problems/first-bad-version.rb rename to problems/rb/first-bad-version.rb diff --git a/problems/insert-into-a-binary-search-tree.rb b/problems/rb/insert-into-a-binary-search-tree.rb similarity index 100% rename from problems/insert-into-a-binary-search-tree.rb rename to problems/rb/insert-into-a-binary-search-tree.rb diff --git a/problems/linked-list-cycle-ii.rb b/problems/rb/linked-list-cycle-ii.rb similarity index 100% rename from problems/linked-list-cycle-ii.rb rename to problems/rb/linked-list-cycle-ii.rb diff --git a/problems/maximum-subarray.rb b/problems/rb/maximum-subarray.rb similarity index 100% rename from problems/maximum-subarray.rb rename to problems/rb/maximum-subarray.rb diff --git a/problems/merge-sorted-array.rb b/problems/rb/merge-sorted-array.rb similarity index 100% rename from problems/merge-sorted-array.rb rename to problems/rb/merge-sorted-array.rb diff --git a/problems/min-cost-climbing-stairs.rb b/problems/rb/min-cost-climbing-stairs.rb similarity index 100% rename from problems/min-cost-climbing-stairs.rb rename to problems/rb/min-cost-climbing-stairs.rb diff --git a/problems/rotate-array.rb b/problems/rb/rotate-array.rb similarity index 100% rename from problems/rotate-array.rb rename to problems/rb/rotate-array.rb diff --git a/problems/search-insert-position.rb b/problems/rb/search-insert-position.rb similarity index 100% rename from problems/search-insert-position.rb rename to problems/rb/search-insert-position.rb diff --git a/problems/squares-of-a-sorted-array.rb b/problems/rb/squares-of-a-sorted-array.rb similarity index 100% rename from problems/squares-of-a-sorted-array.rb rename to problems/rb/squares-of-a-sorted-array.rb diff --git a/problems/tribonacci.rb b/problems/rb/tribonacci.rb similarity index 100% rename from problems/tribonacci.rb rename to problems/rb/tribonacci.rb diff --git a/problems/two-sum.rb b/problems/rb/two-sum.rb similarity index 100% rename from problems/two-sum.rb rename to problems/rb/two-sum.rb diff --git a/problems/word-pattern.rb b/problems/rb/word-pattern.rb similarity index 100% rename from problems/word-pattern.rb rename to problems/rb/word-pattern.rb diff --git a/problems/add-digits.rs b/problems/rs/add-digits.rs similarity index 100% rename from problems/add-digits.rs rename to problems/rs/add-digits.rs diff --git a/problems/best-time-to-buy-and-sell-stock-iv.rs b/problems/rs/best-time-to-buy-and-sell-stock-iv.rs similarity index 100% rename from problems/best-time-to-buy-and-sell-stock-iv.rs rename to problems/rs/best-time-to-buy-and-sell-stock-iv.rs diff --git a/problems/binary-tree-inorder-traversal.rs b/problems/rs/binary-tree-inorder-traversal.rs similarity index 100% rename from problems/binary-tree-inorder-traversal.rs rename to problems/rs/binary-tree-inorder-traversal.rs diff --git a/problems/binary-trees-with-factors.rs b/problems/rs/binary-trees-with-factors.rs similarity index 100% rename from problems/binary-trees-with-factors.rs rename to problems/rs/binary-trees-with-factors.rs diff --git a/problems/complex-number-multiplication.rs b/problems/rs/complex-number-multiplication.rs similarity index 100% rename from problems/complex-number-multiplication.rs rename to problems/rs/complex-number-multiplication.rs diff --git a/problems/count-vowels-permutation.rs b/problems/rs/count-vowels-permutation.rs similarity index 100% rename from problems/count-vowels-permutation.rs rename to problems/rs/count-vowels-permutation.rs diff --git a/problems/find-pivot-index.rs b/problems/rs/find-pivot-index.rs similarity index 100% rename from problems/find-pivot-index.rs rename to problems/rs/find-pivot-index.rs diff --git a/problems/find-the-longest-valid-obstacle-course-at-each-position.rs b/problems/rs/find-the-longest-valid-obstacle-course-at-each-position.rs similarity index 100% rename from problems/find-the-longest-valid-obstacle-course-at-each-position.rs rename to problems/rs/find-the-longest-valid-obstacle-course-at-each-position.rs diff --git a/problems/is-graph-bipartite.rs b/problems/rs/is-graph-bipartite.rs similarity index 100% rename from problems/is-graph-bipartite.rs rename to problems/rs/is-graph-bipartite.rs diff --git a/problems/kids-with-the-greatest-number-of-candies.rs b/problems/rs/kids-with-the-greatest-number-of-candies.rs similarity index 100% rename from problems/kids-with-the-greatest-number-of-candies.rs rename to problems/rs/kids-with-the-greatest-number-of-candies.rs diff --git a/problems/longest-increasing-subsequence.rs b/problems/rs/longest-increasing-subsequence.rs similarity index 100% rename from problems/longest-increasing-subsequence.rs rename to problems/rs/longest-increasing-subsequence.rs diff --git a/problems/longest-palindromic-subsequence.rs b/problems/rs/longest-palindromic-subsequence.rs similarity index 100% rename from problems/longest-palindromic-subsequence.rs rename to problems/rs/longest-palindromic-subsequence.rs diff --git a/problems/maximum-number-of-coins-you-can-get.rs b/problems/rs/maximum-number-of-coins-you-can-get.rs similarity index 100% rename from problems/maximum-number-of-coins-you-can-get.rs rename to problems/rs/maximum-number-of-coins-you-can-get.rs diff --git a/problems/maximum-value-of-k-coins-from-piles.rs b/problems/rs/maximum-value-of-k-coins-from-piles.rs similarity index 100% rename from problems/maximum-value-of-k-coins-from-piles.rs rename to problems/rs/maximum-value-of-k-coins-from-piles.rs diff --git a/problems/minimum-number-of-vertices-to-reach-all-nodes.rs b/problems/rs/minimum-number-of-vertices-to-reach-all-nodes.rs similarity index 100% rename from problems/minimum-number-of-vertices-to-reach-all-nodes.rs rename to problems/rs/minimum-number-of-vertices-to-reach-all-nodes.rs diff --git a/problems/number-of-islands.rs b/problems/rs/number-of-islands.rs similarity index 100% rename from problems/number-of-islands.rs rename to problems/rs/number-of-islands.rs diff --git a/problems/pacific-atlantic-water-flow.rs b/problems/rs/pacific-atlantic-water-flow.rs similarity index 100% rename from problems/pacific-atlantic-water-flow.rs rename to problems/rs/pacific-atlantic-water-flow.rs diff --git a/problems/power-of-four.rs b/problems/rs/power-of-four.rs similarity index 100% rename from problems/power-of-four.rs rename to problems/rs/power-of-four.rs diff --git a/problems/range-sum-query-immutable.rs b/problems/rs/range-sum-query-immutable.rs similarity index 100% rename from problems/range-sum-query-immutable.rs rename to problems/rs/range-sum-query-immutable.rs diff --git a/problems/reduce-array-size-to-the-half.rs b/problems/rs/reduce-array-size-to-the-half.rs similarity index 100% rename from problems/reduce-array-size-to-the-half.rs rename to problems/rs/reduce-array-size-to-the-half.rs diff --git a/problems/running-sum-of-1d-array.rs b/problems/rs/running-sum-of-1d-array.rs similarity index 100% rename from problems/running-sum-of-1d-array.rs rename to problems/rs/running-sum-of-1d-array.rs diff --git a/problems/shortest-path-in-binary-matrix.rs b/problems/rs/shortest-path-in-binary-matrix.rs similarity index 100% rename from problems/shortest-path-in-binary-matrix.rs rename to problems/rs/shortest-path-in-binary-matrix.rs diff --git a/problems/simplify-path.rs b/problems/rs/simplify-path.rs similarity index 100% rename from problems/simplify-path.rs rename to problems/rs/simplify-path.rs diff --git a/problems/smallest-number-in-infinite-set.rs b/problems/rs/smallest-number-in-infinite-set.rs similarity index 100% rename from problems/smallest-number-in-infinite-set.rs rename to problems/rs/smallest-number-in-infinite-set.rs diff --git a/problems/solving-questions-with-brainpower.rs b/problems/rs/solving-questions-with-brainpower.rs similarity index 100% rename from problems/solving-questions-with-brainpower.rs rename to problems/rs/solving-questions-with-brainpower.rs diff --git a/problems/sort-characters-by-frequency.rs b/problems/rs/sort-characters-by-frequency.rs similarity index 100% rename from problems/sort-characters-by-frequency.rs rename to problems/rs/sort-characters-by-frequency.rs diff --git a/problems/stamping-the-sequence.rs b/problems/rs/stamping-the-sequence.rs similarity index 100% rename from problems/stamping-the-sequence.rs rename to problems/rs/stamping-the-sequence.rs diff --git a/problems/the-number-of-weak-characters-in-the-game.rs b/problems/rs/the-number-of-weak-characters-in-the-game.rs similarity index 100% rename from problems/the-number-of-weak-characters-in-the-game.rs rename to problems/rs/the-number-of-weak-characters-in-the-game.rs diff --git a/problems/validate-stack-sequences.rs b/problems/rs/validate-stack-sequences.rs similarity index 100% rename from problems/validate-stack-sequences.rs rename to problems/rs/validate-stack-sequences.rs diff --git a/problems/contains-duplicate.swift b/problems/swift/contains-duplicate.swift similarity index 100% rename from problems/contains-duplicate.swift rename to problems/swift/contains-duplicate.swift diff --git a/problems/number-complement.swift b/problems/swift/number-complement.swift similarity index 100% rename from problems/number-complement.swift rename to problems/swift/number-complement.swift diff --git a/problems/two-sum.swift b/problems/swift/two-sum.swift similarity index 100% rename from problems/two-sum.swift rename to problems/swift/two-sum.swift diff --git a/problems/valid-parentheses.swift b/problems/swift/valid-parentheses.swift similarity index 100% rename from problems/valid-parentheses.swift rename to problems/swift/valid-parentheses.swift