Open in app

Sign In

Write

Sign In

Palash Sharma
Palash Sharma

64 Followers

Home

About

Sep 2, 2022

39. Combination Sum — LeetCode(Python)

I got you! Problem: Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number…

Python

2 min read

Python

2 min read


Sep 2, 2022

78. Subsets — LeetCode(Python)

I got you! Problem: Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example 1: Input: nums = [1,2,3] Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]] Example 2: Input: nums = [0] Output: [[],[0]] Constraints: 1…

Python

2 min read

Python

2 min read


Aug 9, 2022

973. K Closest Points to Origin — LeetCode(Python)

I got you! Problem: Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). The distance between two points on the X-Y plane is the Euclidean distance (i.e., …

Python

3 min read

973. K Closest Points to Origin — LeetCode(Python)
973. K Closest Points to Origin — LeetCode(Python)
Python

3 min read


Aug 9, 2022

1046. Last Stone Weight — LeetCode(Python)

I got you! Problem: You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and…

Python

2 min read

Python

2 min read


Aug 9, 2022

703. Kth Largest Element in a Stream — LeetCode(Python)

I got you! Problem: Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. Implement KthLargest class: KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of…

Python

2 min read

Python

2 min read


Jul 22, 2022

235. Lowest Common Ancestor of a Binary Search Tree — LeetCode(Python)

I got you! Problem: Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that…

Leetcode

3 min read

Leetcode

3 min read


Jul 22, 2022

572. Subtree of Another Tree — LeetCode(Python)

I got you! Problem: Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a binary tree tree is a tree that consists of a node in…

Leetcode

4 min read

572. Subtree of Another Tree — LeetCode(Python)
572. Subtree of Another Tree — LeetCode(Python)
Leetcode

4 min read


Jul 22, 2022

100. Same Tree -LeetCode(Python)

I got you! Problem: Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value. Example 1: Input: p = [1,2,3]…

Leetcode

3 min read

Leetcode

3 min read


Jul 22, 2022

110. Balanced Binary Tree — LeetCode (Python)

I got you! Problem: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of every node differ in height by no more than 1. Example 1: Input: root = [3,9,20,null,null,15,7] Output…

Leetcode

2 min read

110. Balanced Binary Tree — LeetCode (Python)
110. Balanced Binary Tree — LeetCode (Python)
Leetcode

2 min read


Jul 22, 2022

543. Diameter of Binary Tree — LeetCode(Python)

I got you! Problem: Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. The…

Leetcode

2 min read

543. Diameter of Binary Tree — LeetCode(Python)
543. Diameter of Binary Tree — LeetCode(Python)
Leetcode

2 min read

Palash Sharma

Palash Sharma

64 Followers

A student of science | palashsharma891@gmail.com | https://github.com/palashsharma891 | https://www.linkedin.com/in/palashsharma891/

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech