prakhardoneria - HTMLify profile
files of /prakhardoneria/LeetCode/
construct-the-minimum-bitwise-array-i.py
/prakhardoneria/LeetCode/construct-the-minimum-bitwise-array-i.py
class Solution:
def minBitwiseArray(self, nums: List[int]) -> List[int]:
ans = []
for x in nums:
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
class Solution:
def minBitwiseArray(self, nums: List[int]) -> List[int]:
ans = []
for p in nums:
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
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
n, m = len(haystack), len(needle)
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
class Solution:
def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
max_side
def largestSquareArea(self, bottomLeft: List[List[int]], topRight: List[List[int]]) -> int:
max_side
class Solution:
def sumFourDivisors(self, nums: List[int]) -> int:
total_sum = 0
for num in nums:
def sumFourDivisors(self, nums: List[int]) -> int:
total_sum = 0
for num in nums:
class Solution:
def largestMagicSquare(self, grid: List[List[int]]) -> int:
m, n = len(grid), len(grid[0])
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
class Solution:
def maxDotProduct(self, nums1: List[int], nums2: List[int]) -> int:
n, m = len(nums1), len(nums2)
def maxDotProduct(self, nums1: List[int], nums2: List[int]) -> int:
n, m = len(nums1), len(nums2)
class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
if not matrix or not matrix[0]:
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
class Solution:
def maximizeSquareHoleArea(self, n: int, m: int, hBars: List[int], vBars: List[int]) -> int:
def get
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
from collections import deque
class Solution:
def maxLevelSum(self, root: Optional[TreeNode]) -> int:
if not root:
class Solution:
def maxLevelSum(self, root: Optional[TreeNode]) -> int:
if not root:
class Solution:
def maxMatrixSum(self, matrix):
total_sum = 0
min_abs = float('inf')
negative_count
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
class Solution:
def maxProduct(self, root: Optional[TreeNode]) -> int:
subtree_sums = []
def calcul
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
class Solution:
def maxSideLength(self, mat: List[List[int]], threshold: int) -> int:
m, n = len(mat), len(mat[0])
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
class Solution:
def maximizeSquareArea(self, m: int, n: int, hFences: List[int], vFences: List[int]) -> int:
hFences
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
class Solution:
def minPairSum(self, nums: List[int]) -> int:
nums.sort()
max_sum = 0
n = len(nums)
def minPairSum(self, nums: List[int]) -> int:
nums.sort()
max_sum = 0
n = len(nums)
class Solution:
def minimumAbsDifference(self, arr: List[int]) -> List[List[int]]:
arr.sort()
min_diff = flo
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
class Solution:
def minimumDeleteSum(self, s1: str, s2: str) -> int:
n, m = len(s1), len(s2)
dp = [[0] * (m
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
class Solution:
def minimumDifference(self, nums: List[int], k: int) -> int:
if k == 1:
return 0
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
class Solution:
def minimumPairRemoval(self, nums: List[int]) -> int:
operations = 0
while True:
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
class Solution:
def minimumPairRemoval(self, nums: List[int]) -> int:
n = len(nums)
sl = SortedList()
def minimumPairRemoval(self, nums: List[int]) -> int:
n = len(nums)
sl = SortedList()
class Solution:
def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:
total_time = 0
f
def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:
total_time = 0
f
int numOfWays(int n) {
long long mod = 1e9 + 7;
long long aba = 6;
long long abc = 6;
for (int i = 1; i < n; i+
long long mod = 1e9 + 7;
long long aba = 6;
long long abc = 6;
for (int i = 1; i < n; i+
class Solution:
def separateSquares(self, squares: List[List[int]]) -> float:
total_area = sum(s[2] * s[2] for s in
def separateSquares(self, squares: List[List[int]]) -> float:
total_area = sum(s[2] * s[2] for s in
from typing import List
class Solution:
def separateSquares(self, squares: List[List[int]]) -> float:
x_coords = se
class Solution:
def separateSquares(self, squares: List[List[int]]) -> float:
x_coords = se