Skip to content

Instantly share code, notes, and snippets.

View priyankvex's full-sized avatar
💭
Chilling 🍺

Priyank Verma priyankvex

💭
Chilling 🍺
View GitHub Profile
@priyankvex
priyankvex / longest_substring_with_unique_characters.py
Created June 26, 2019 13:54
Longest substring with unique characters
class Solution(object):
def solve(self, s):
start = 0
end = 1
max_start = 0
max_end = 0
map = {}
@priyankvex
priyankvex / find_the_duplicate_number.py
Created May 23, 2019 14:28
Find the duplicate number
"""
https://scammingthecodinginterview.com
Week 5: Two Pointer
Problem: 2
"""
class Solution(object):
def solve(self, a):
@priyankvex
priyankvex / remove_duplicates_from_sorted_array_wthout_extra_space.py
Created May 20, 2019 15:01
Remove duplicates from a sorted array without extra space
"""
https://scammingthecodinginterview.com
Week 5: Two Pointer
Problem: 1
"""
class Solution(object):
def solve(self, a):
@priyankvex
priyankvex / minimum_characters_to_be_added_to_make_palindrome.py
Created May 15, 2019 16:16
Minimum letters to be added to make string a palindrome
"""
https://scammingthecodinginterview.com
Week 4: Strings
Problem: 2
"""
class Solution(object):
def solve(self, s):
@priyankvex
priyankvex / letter_combinations_from_numbers.py
Created May 13, 2019 13:21
Letter combinations from numbers
"""
https://scammingthecodinginterview.com
Week 4: Strings
Problem: 1
"""
class Solution(object):
def solve(self, numbers):
@priyankvex
priyankvex / letter_combinations_from_numbers.py
Created May 13, 2019 13:21
Letter combinations from numbers
"""
https://scammingthecodinginterview.com
Week 4: Strings
Problem: 1
"""
class Solution(object):
def solve(self, numbers):
@priyankvex
priyankvex / remove_k_digits_to_form_the_smallest_number.py
Created May 11, 2019 16:23
Remove K digits to find the smallest number
"""
https://scammingthecodinginterview.com
Week 3: Greedy
Problem: 3
"""
class Solution(object):
def solve(self, a, k):
out = []
@priyankvex
priyankvex / maximum_sum_after_k_negations.py
Created May 7, 2019 18:31
Maximum sum after K negations
"""
https://scammingthecodinginterview.com
Week 3: Greedy
Problem: 3
"""
class Solution(object):
def solve(self, a, k):
@priyankvex
priyankvex / gas_station_complete_circle.py
Last active May 6, 2019 17:36
Gas station completing the circuit
"""
https://scammingthecodinginterview.com
Week 3: Greedy
Problem: 2
"""
class Solution(object):
def solve(self, fuel, cost):
"""
https://scammingthecodinginterview.com
Week 3: Greedy
Problem: 1
"""
from typing import List