SSSk Shoyebinskshoyebjavascript.hashnode.dev·1d ago · 3 min readMaximum Number of Non-Overlapping Substrings | Java Solution | GreedyGiven a string s of lowercase letters, you need to find the maximum number of non-empty substrings of s that meet the following conditions: The substrings do not overlap, that is for any two substrin00
SSSk Shoyebinskshoyebjavascript.hashnode.dev·Jul 4 · 3 min readMaking A Large Island Graph DSU Java SolutionYou are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applying this operation. An island is a 4-directionally 00
SSSk Shoyebinskshoyebjavascript.hashnode.dev·Jul 4 · 3 min readAccount Merge Graph DSU Solution - JAVA Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the accou00
SSSk Shoyebinskshoyebjavascript.hashnode.dev·Mar 18 · 2 min readShortest Common Supersequence DP JavaScript Code With ExplainationGiven two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them. A string s is a subsequence of string 00
SSSk Shoyebinskshoyebjavascript.hashnode.dev·Mar 17 · 2 min readPrint All LCS Sequence JS DP + Backtracking SolutionAll LCS sequence is a hard problem in dynamic programming. In this article we will solve this with dymanic programming approach with backtracking and memoization in javascript. First we need to make t00