Skip to content

Commit 72ef7fa

Browse files
authored
Merge pull request #801 from fartem/606-Construct-String-from-Binary-Tree
2024-12-12 v. 7.3.0: added "606. Construct String from Binary Tree"
2 parents 899a094 + 2b9538d commit 72ef7fa

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ Profile on LeetCode: [fartem](https://leetcode.com/fartem/).
127127
| 590. N-ary Tree Postorder Traversal | [Link](https://leetcode.com/problems/n-ary-tree-postorder-traversal/) | [Link](./lib/easy/590_n_ary_tree_postorder_traversal.rb) | [Link](./test/easy/test_590_n_ary_tree_postorder_traversal.rb) |
128128
| 594. Longest Harmonious Subsequence | [Link](https://leetcode.com/problems/longest-harmonious-subsequence/) | [Link](./lib/easy/594_longest_harmonious_subsequence.rb) | [Link](./test/easy/test_594_longest_harmonious_subsequence.rb) |
129129
| 599. Minimum Index Sum of Two Lists | [Link](https://leetcode.com/problems/minimum-index-sum-of-two-lists/) | [Link](./lib/easy/599_minimum_index_sum_of_two_lists.rb) | [Link](./test/easy/test_599_minimum_index_sum_of_two_lists.rb) |
130-
| 606. Construct String from Binary Tree | [Link](https://leetcode.com/problems/construct-string-from-binary-tree/) | [Link](./lib/easy/606_construct_string_from_binary_tree.rb) | [Link](./test/easy/test_606_construct_string_from_binary_tree.rb) |
131130
| 617. Merge Two Binary Trees | [Link](https://leetcode.com/problems/merge-two-binary-trees/) | [Link](./lib/easy/617_merge_two_binary_trees.rb) | [Link](./test/easy/test_617_merge_two_binary_trees.rb) |
132131
| 628. Maximum Product of Three Numbers | [Link](https://leetcode.com/problems/maximum-product-of-three-numbers/) | [Link](./lib/easy/628_maximum_product_of_three_numbers.rb) | [Link](./test/easy/test_628_maximum_product_of_three_numbers.rb) |
133132
| 637. Average of Levels in Binary Tree | [Link](https://leetcode.com/problems/average-of-levels-in-binary-tree/) | [Link](./lib/easy/637_average_of_levels_in_binary_tree.rb) | [Link](./test/easy/test_637_average_of_levels_in_binary_tree.rb) |
@@ -595,3 +594,4 @@ Profile on LeetCode: [fartem](https://leetcode.com/fartem/).
595594
| 556. Next Greater Element III | [Link](https://leetcode.com/problems/next-greater-element-iii/) | [Link](./lib/medium/556_next_greater_element_iii.rb) | [Link](./test/medium/test_556_next_greater_element_iii.rb) |
596595
| 560. Subarray Sum Equals K | [Link](https://leetcode.com/problems/subarray-sum-equals-k/) | [Link](./lib/medium/560_subarray_sum_equals_k.rb) | [Link](./test/medium/test_560_subarray_sum_equals_k.rb) |
597596
| 581. Shortest Unsorted Continuous Subarray | [Link](https://leetcode.com/problems/shortest-unsorted-continuous-subarray/) | [Link](./lib/medium/581_shortest_unsorted_continuous_subarray.rb) | [Link](./test/medium/test_581_shortest_unsorted_continuous_subarray.rb) |
597+
| 606. Construct String from Binary Tree | [Link](https://leetcode.com/problems/construct-string-from-binary-tree/) | [Link](./lib/medium/606_construct_string_from_binary_tree.rb) | [Link](./test/medium/test_606_construct_string_from_binary_tree.rb) |

leetcode-ruby.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require 'English'
55
::Gem::Specification.new do |s|
66
s.required_ruby_version = '>= 3.0'
77
s.name = 'leetcode-ruby'
8-
s.version = '7.2.9'
8+
s.version = '7.3.0'
99
s.license = 'MIT'
1010
s.files = ::Dir['lib/**/*.rb'] + %w[README.md]
1111
s.executable = 'leetcode-ruby'

lib/easy/606_construct_string_from_binary_tree.rb renamed to lib/medium/606_construct_string_from_binary_tree.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def tree2str(root)
1010
result.join
1111
end
1212

13+
private
14+
1315
# @param {TreeNode} node
1416
# @param {String[]} str
1517
def tree_to_str(node, str)

test/easy/test_606_construct_string_from_binary_tree.rb renamed to test/medium/test_606_construct_string_from_binary_tree.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_relative '../test_helper'
44
require_relative '../../lib/common/binary_tree'
5-
require_relative '../../lib/easy/606_construct_string_from_binary_tree'
5+
require_relative '../../lib/medium/606_construct_string_from_binary_tree'
66
require 'minitest/autorun'
77

88
class ConstructStringFromBinaryTreeTest < ::Minitest::Test

0 commit comments

Comments
 (0)