This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int maxLength | |
int maxStart | |
int start | |
some set S | |
for each character C in the input string | |
check if this character is a repeated character (look for C in S) | |
if it is, repeat this: | |
look at the first character in my candidate substring. | |
remove that character from the front of the substring. (increment start) | |
remove that character also from S. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DSA { | |
public class LongestSubstringProblem { | |
public static string HashSetSolution(string input) { | |
if (string.IsNullOrEmpty(input)) | |
return string.Empty; | |
var (candidateStart, candidateLength) = (0, 1); | |
var current = new HashSet<char>(); | |
int start = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.CompilerServices; | |
namespace DSA { | |
public class LongestSubstringProblem { | |
/// <summary> | |
/// Solves the LongestSubstringProblem in O(N) time without any generic data structures or custom data structures. | |
/// </summary> | |
/// <param name="input"></param> | |
/// <returns></returns> | |
public static string SimpleBitMaskSolution(string input) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import selenium | |
from selenium.webdriver import Chrome | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.by import By | |
from selenium.common.exceptions import ElementNotInteractableException | |
import numpy as np | |
import scipy.stats as st | |
try: | |
options = Options() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def convert_quotes(html: str): | |
"""Replace dumb quotes with smart quotes in HTML.""" | |
# set flags to false. | |
# we assume that the HTML is well-formed and that we are starting at the beginning. | |
in_html_tag = False | |
in_quote = False | |
# convert all quotes to basic quotes. this might not be necessary, | |
# but it is if there is any chance the quotes in the document need |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Garbage | |
{ | |
public class Garbage | |
{ | |
public int GarbageId { get; set; } | |
public string Name { get; set; } | |
public GarbageType Type { get; set; } | |
} | |
public enum GarbageType |