Open
Conversation
mamo3gr
reviewed
Feb 15, 2026
Comment on lines
+167
to
+171
| final mergedLeft = mergeNodes(source1?.left, source2?.left); | ||
| final mergedRight = mergeNodes(source1?.right, source2?.right); | ||
|
|
||
| parent.left = mergedLeft; | ||
| parent.right = mergedRight; |
There was a problem hiding this comment.
そのまま代入してしまっても通じそうです。
Suggested change
| final mergedLeft = mergeNodes(source1?.left, source2?.left); | |
| final mergedRight = mergeNodes(source1?.right, source2?.right); | |
| parent.left = mergedLeft; | |
| parent.right = mergedRight; | |
| parent.left = mergeNodes(source1?.left, source2?.left); | |
| parent.right = mergeNodes(source1?.right, source2?.right); |
一旦束縛したいのであれば、空行は無くても良さそうです。
Suggested change
| final mergedLeft = mergeNodes(source1?.left, source2?.left); | |
| final mergedRight = mergeNodes(source1?.right, source2?.right); | |
| parent.left = mergedLeft; | |
| parent.right = mergedRight; | |
| final mergedLeft = mergeNodes(source1?.left, source2?.left); | |
| final mergedRight = mergeNodes(source1?.right, source2?.right); | |
| parent.left = mergedLeft; | |
| parent.right = mergedRight; |
mamo3gr
reviewed
Feb 15, 2026
Comment on lines
+173
to
+175
| if (mergedLeft != null) { | ||
| mergeSourcesWithParent.add((source1?.left, source2?.left, mergedLeft)); | ||
| } |
There was a problem hiding this comment.
dart的なお作法に逆らわないのであれば、rightと対称にしたいです。
Suggested change
| if (mergedLeft != null) { | |
| mergeSourcesWithParent.add((source1?.left, source2?.left, mergedLeft)); | |
| } | |
| if (mergedLeft != null) { | |
| mergeSourcesWithParent.add(( | |
| source1?.left, | |
| source2?.left, | |
| mergedLeft, | |
| )); | |
| } |
Owner
Author
There was a problem hiding this comment.
レビューありがとうございます。
完全に同意します。おそらくフォーマッターで非対称になってしまったと思われます。
There was a problem hiding this comment.
フォーマッターのオプションで固定できそうですかね。
ちなみに、Pythonのフォーマッターであるruffでは、末尾にカンマを入れると、取り除かれずにスレッド元のようなフォーマットになりました(つまりデフォルトの設定で、意図的に対称な形にできる)。dartではどうかわかりませんがご参考まで。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解いた問題:https://leetcode.com/problems/merge-two-binary-trees/description/
次に解く問題:https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/description/