View maximumLineInMatrix.cs
public int LongestLine(int[][] M) { | |
if(M == null || M.Length == 0 || M[0].Length == 0) | |
{ | |
return 0; | |
} | |
var rows = M.Length; | |
var columns = M[0].Length; | |
var dpH = new int[rows][]; |
View Leetcode737SentenceSimilarity.cs
public class Solution { | |
/// <summary> | |
/// Nov. 19, 2020 | |
/// study code | |
/// https://leetcode.com/problems/sentence-similarity-ii/solution/ | |
/// Time Complexity: O(NP), where N is the maximum length of words1 and words2, | |
/// and P is the length of pairs. Each of N searches could search the entire graph. | |
/// </summary> | |
/// <param name="words1"></param> | |
/// <param name="words2"></param> |
View 801MinimumSwapsToMakeSequencesIncreasing.js
const _ = require('lodash'); | |
function sayHello() { | |
console.log('Hello, World'); | |
} | |
_.times(5, sayHello); | |
/* |
View Leetcode1657-TwoStringClose.cs
public class Solution { | |
public bool CloseStrings(string word1, string word2) { | |
if(word1.Length != word2.Length) | |
return false; | |
var map = new int[26]; | |
for(int i = 0; i < 26; i++) | |
{ | |
map[i] = -1; | |
} |
View MinimumWindowSubsequence
Problem statement: | |
Given a string S and a string t , find the minimum window substring in S which contains all the characters of the string T in the same order. | |
import java.io.*; | |
import java.util.*; | |
class Solution { | |
public static void main(String[] args) { | |
} |
View wordBreak.Java
/* | |
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. | |
Note: | |
The same word in the dictionary may be reused multiple times in the segmentation. | |
You may assume the dictionary does not contain duplicate words. | |
Example 1: | |
Input: s = "leetcode", wordDict = ["leet", "code"] |
View 425WordSquare.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace _435_word_square | |
{ | |
class Program | |
{ |
View 358rearrangeStringKDistance.cs
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace _358_rearrange_string_k_distance_apart | |
{ | |
class Program |
View 358RearrangeStringKDistance.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace _358_Heap_LinkedList | |
{ | |
class Program | |
{ |
View SearchFindshortestPathFriend
This editor is synced in real time with your peer. | |
Use it to share thoughts and resources, such as: | |
- Features scope | |
- API design | |
- Pseudo code for specific components | |
- Data model/schema | |
- Back-of-the-envelope calculations | |
- Reference links | |
- Link to whiteboard or diagram such as https://sketchboard.me/new |
NewerOlder