Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Null Safety: Fix #176 #247

Closed
wants to merge 15 commits into from
Prev Previous commit
Next Next commit
Null Safe: trees
akashgk committed Apr 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a132f20218360aec6044228f7c4876246051108e
6 changes: 3 additions & 3 deletions trees/path_sum.dart
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ import 'package:test/test.dart';
// Question URL: https://leetcode.com/problems/path-sum/description/
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode? left;
TreeNode? right;
TreeNode([this.val = 0, this.left, this.right]);
}

@@ -15,7 +15,7 @@ bool isLeaf(TreeNode node) {
return false;
}

bool traverse(TreeNode node, int targetSum, int runningSum) {
bool traverse(TreeNode? node, int targetSum, int runningSum) {
if (node == null) {
return false;
}