Dashboard Temp Share Shortlinks Frames API

prakhardoneria - HTMLify profile

files of /prakhardoneria/LeetCode/

construct-the-minimum-bitwise-array-i.py /prakhardoneria/LeetCode/construct-the-minimum-bitwise-array-i.py
29 Views
0 Comments
class Solution:
def minBitwiseArray(self, nums: List[int]) -> List[int]:
ans = []
for x in nums:

construct-the-minimum-bitwise-array-ii.py /prakhardoneria/LeetCode/construct-the-minimum-bitwise-array-ii.py
28 Views
0 Comments
class Solution:
def minBitwiseArray(self, nums: List[int]) -> List[int]:
ans = []
for p in nums:

find-the-index-of-the-first-occurrence-in-a-string.py /prakhardoneria/LeetCode/find-the-index-of-the-first-occurrence-in-a-string.py
178 Views
0 Comments
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
n, m = len(haystack), len(needle)


find-the-largest-area-of-square-inside-two-rectangle.py /prakhardoneria/LeetCode/find-the-largest-area-of-square-inside-two-rectangle.py
27 Views
0 Comments
class Solution:
def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
max_side
four-divisors.py /prakhardoneria/LeetCode/four-divisors.py
78 Views
0 Comments
class Solution:
def sumFourDivisors(self, nums: List[int]) -> int:
total_sum = 0
for num in nums:

largest-magic-square.py /prakhardoneria/LeetCode/largest-magic-square.py
32 Views
0 Comments
class Solution:
def largestMagicSquare(self, grid: List[List[int]]) -> int:
m, n = len(grid), len(grid[0])


max-dot-product-of-two-subsequences.py /prakhardoneria/LeetCode/max-dot-product-of-two-subsequences.py
68 Views
0 Comments
class Solution:
def maxDotProduct(self, nums1: List[int], nums2: List[int]) -> int:
n, m = len(nums1), len(nums2)

maximal-rectangle.py /prakhardoneria/LeetCode/maximal-rectangle.py
56 Views
0 Comments
class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
if not matrix or not matrix[0]:

maximize-area-of-square-hole-in-grid.py /prakhardoneria/LeetCode/maximize-area-of-square-hole-in-grid.py
44 Views
0 Comments
class Solution:
def maximizeSquareHoleArea(self, n: int, m: int, hBars: List[int], vBars: List[int]) -> int:
def get
maximum-level-sum-of-a-binary-tree.py /prakhardoneria/LeetCode/maximum-level-sum-of-a-binary-tree.py
48 Views
0 Comments
from collections import deque

class Solution:
def maxLevelSum(self, root: Optional[TreeNode]) -> int:
if not root:

maximum-matrix-sum.py /prakhardoneria/LeetCode/maximum-matrix-sum.py
47 Views
0 Comments
class Solution:
def maxMatrixSum(self, matrix):
total_sum = 0
min_abs = float('inf')
negative_count
maximum-product-of-splitted-binary-tree.py /prakhardoneria/LeetCode/maximum-product-of-splitted-binary-tree.py
49 Views
0 Comments
class Solution:
def maxProduct(self, root: Optional[TreeNode]) -> int:
subtree_sums = []

def calcul
maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.py /prakhardoneria/LeetCode/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold.py
28 Views
0 Comments
class Solution:
def maxSideLength(self, mat: List[List[int]], threshold: int) -> int:
m, n = len(mat), len(mat[0])

maximum-square-area-by-removing-fences-from-a-field.py /prakhardoneria/LeetCode/maximum-square-area-by-removing-fences-from-a-field.py
32 Views
0 Comments
class Solution:
def maximizeSquareArea(self, m: int, n: int, hFences: List[int], vFences: List[int]) -> int:
hFences
minimize-maximum-pair-sum-in-array.py /prakhardoneria/LeetCode/minimize-maximum-pair-sum-in-array.py
21 Views
0 Comments
class Solution:
def minPairSum(self, nums: List[int]) -> int:
nums.sort()
max_sum = 0
n = len(nums)

minimum-absolute-difference.py /prakhardoneria/LeetCode/minimum-absolute-difference.py
27 Views
0 Comments
class Solution:
def minimumAbsDifference(self, arr: List[int]) -> List[List[int]]:
arr.sort()
min_diff = flo
minimum-ascii-delete-sum-for-two-strings.py /prakhardoneria/LeetCode/minimum-ascii-delete-sum-for-two-strings.py
44 Views
0 Comments
class Solution:
def minimumDeleteSum(self, s1: str, s2: str) -> int:
n, m = len(s1), len(s2)
dp = [[0] * (m
minimum-difference-between-highest-and-lowest-of-k-scores.py /prakhardoneria/LeetCode/minimum-difference-between-highest-and-lowest-of-k-scores.py
17 Views
0 Comments
class Solution:
def minimumDifference(self, nums: List[int], k: int) -> int:
if k == 1:
return 0

minimum-pair-removal-to-sort-array-i.py /prakhardoneria/LeetCode/minimum-pair-removal-to-sort-array-i.py
28 Views
0 Comments
class Solution:
def minimumPairRemoval(self, nums: List[int]) -> int:
operations = 0

while True:

minimum-pair-removal-to-sort-array-ii.py /prakhardoneria/LeetCode/minimum-pair-removal-to-sort-array-ii.py
24 Views
0 Comments
class Solution:
def minimumPairRemoval(self, nums: List[int]) -> int:
n = len(nums)
sl = SortedList()

minimum-time-visiting-all-points.py /prakhardoneria/LeetCode/minimum-time-visiting-all-points.py
45 Views
0 Comments
class Solution:
def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:
total_time = 0

f
number-of-ways-to-paint-n-3-grid.c /prakhardoneria/LeetCode/number-of-ways-to-paint-n-3-grid.c
129 Views
0 Comments
int numOfWays(int n) {
long long mod = 1e9 + 7;
long long aba = 6;
long long abc = 6;

for (int i = 1; i < n; i+
separate-squares-i.py /prakhardoneria/LeetCode/separate-squares-i.py
45 Views
0 Comments
class Solution:
def separateSquares(self, squares: List[List[int]]) -> float:
total_area = sum(s[2] * s[2] for s in
separate-squares-ii.py /prakhardoneria/LeetCode/separate-squares-ii.py
41 Views
0 Comments
from typing import List

class Solution:
def separateSquares(self, squares: List[List[int]]) -> float:
x_coords = se
smallest-subtree-with-all-the-deepest-nodes.py /prakhardoneria/LeetCode/smallest-subtree-with-all-the-deepest-nodes.py
42 Views
0 Comments
class Solution:
def subtreeWithAllDeepest(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
def dfs(node):