Maksim MartianovPromartianov.dev·May 18, 2024Unlocking Scala Mastery with my leetcode Solutions ArchiveIntroduction I have decided to dump my personal leetcode solutions archive. Currently it contains Scala solutions only. I will eventually publish all the remaining solutions in GO, JS and PHP and others. These solutions have been collected over years...Discuss·37 readsScala

Umang Srivastavaoutlierchronicles.hashnode.dev·May 18, 202422. Generate ParenthesesProblem Statement Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Examples Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Example 2: Input: n = 1 Output: ["()"] ...Discuss·10 likesRecursionleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 13, 202478. SubsetsProblem Statement 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. Examples Example 1: Input: nums = [1,2,3] Output: [[...Discuss·10 likesRecursionleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 13, 2024861. Score After Flipping MatrixProblem Statement You are given an m x n binary matrix grid. A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's). Every row of the matrix is interpreted as a ...Discuss·10 likesLeetCode Dailyleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 13, 20241219. Path with Maximum GoldTL;DR The problem involves finding the maximum amount of gold that can be collected from a grid-based gold mine, following specific movement and cell visitation rules. The solution uses recursive backtracking to explore all potential paths, ensuring ...Discuss·10 likesLeetCode Dailyleetcode

Chetan Dattachetan77.hashnode.dev·May 13, 2024Kth element of 2 sorted arraysProblem Given two sorted arrays arr1 and arr2 of size N and M respectively and an element K. The task is to find the element that would be at the kth position of the final sorted array. Example 1: Input: arr1[] = {2, 3, 6, 7, 9} arr2[] = {1, 4, 8, 10...DiscussLeetcodekth-element-of-2-sorted-arrays

Umang Srivastavaoutlierchronicles.hashnode.dev·May 12, 20242373. Largest Local Values in a MatrixProblem Statement You are given an n x n integer matrix grid. Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that: maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + ...Discuss·20 likesLeetCode Dailyleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 9, 2024786. K-th Smallest Prime FractionProblem Statement You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k. For every i and j where 0 <= i < j < arr.length, we consider the fraction arr[i] / a...Discuss·10 likesLeetCode Dailyleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 8, 20243075. Maximize Happiness of Selected ChildrenProblem Statement You are given an array happiness of length n, and a positive integer k. There are n children standing in a queue, where the i<sup>th</sup> child has happiness value happiness[i]. You want to select k children from these n children i...Discuss·10 likesLeetCode Dailyleetcode

Umang Srivastavaoutlierchronicles.hashnode.dev·May 7, 2024506. Relative RanksProblem Statement You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique. The athletes are placed based on their scores, where the 1st place athlete ...Discuss·10 likesLeetCode Dailyleetcode