Monthly Archives: October 2022

sum-of-left-leaves

package us.inest.app.dcp.recursion; import us.inest.app.dcp.tree.TreeNode; public class SumOfLeftLeaves { public static int sumOfLeftLeaves(TreeNode root) { // base case if (root == null) { return 0; } // left child is a leaf node if (root.left != null && root.left.left == null … Continue reading

Posted in recursion | Comments Off on sum-of-left-leaves

remove-nth-node-from-end-of-list

LeetCode link: https://leetcode.com/problems/remove-nth-node-from-end-of-list/submissions/684704570/ Java Solution

Posted in singly-linked list | Comments Off on remove-nth-node-from-end-of-list