chore: split solutions by language

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-06-02 17:19:02 +02:00
parent 078993071a
commit 333866d1bc
Signed by: mfocko
GPG key ID: 7C47D46246790496
131 changed files with 4 additions and 4 deletions

View file

@ -169,4 +169,4 @@ int main()
assert(test_isPalindrome(std::vector { 1 })); assert(test_isPalindrome(std::vector { 1 }));
return 0; return 0;
} }

View file

@ -13,15 +13,15 @@ class Solution {
if (root == null) { if (root == null) {
return levels return levels
} }
if (level + 1 > levels.size) { if (level + 1 > levels.size) {
levels.add(mutableListOf<Int>()) levels.add(mutableListOf<Int>())
} }
levels[level].add(root.`val`) levels[level].add(root.`val`)
levelOrder(root.left, levels, level + 1) levelOrder(root.left, levels, level + 1)
return levelOrder(root.right, levels, level + 1) return levelOrder(root.right, levels, level + 1)
} }
fun levelOrder(root: TreeNode?): List<List<Int>> = levelOrder(root, mutableListOf<MutableList<Int>>(), 0) fun levelOrder(root: TreeNode?): List<List<Int>> = levelOrder(root, mutableListOf<MutableList<Int>>(), 0)
} }

Some files were not shown because too many files have changed in this diff Show more