LeetCode-114. Flatten Binary Tree to Linked List Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ 3 \ 4 \ 5 \ 6 Hints: If you notice carefully in the flattened tree, each...
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(log n). If the target is not found in the array, return [-1, -1]. Example 1: Input: nums = [...
Find the middle element Form The Minimum Give me a Diamond Highest Rank Number in an Array How old will I be in 2099? Insert dashes Integer Difference Is n divisible by (...)? Land perimeter Largest pair sum in array Length and two values Linked Lists - Length & Count longest_palindrome...
leetcode solutions. Contribute to yakash222000/leetcode development by creating an account on GitHub.
Applying heap to find median in a stream The article aims to describe a solution to leetcode 295. Problem: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value....
0169-majority-element.rs 0179-largest-number.rs 0190-reverse-bits.rs 0191-number-of-1-bits.rs 0198-house-robber.rs 0199-binary-tree-right-side-view.rs 0200-number-of-islands.rs 0202-happy-number.rs 0205-isomorphic-strings.rs 0206-reverse-linked-list.rs 0207-course-schedule.rs 0208-implement...