This file contains hidden or 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
# https://leetcode.com/problems/valid-parentheses/#/description | |
class Solution(object): | |
CLOSED_BRACKET_DICT = { | |
')' : '(', | |
'}' : '{', | |
']' : '[' | |
} | |
def isValid(self, s): | |
""" | |
:type s: str |
This file contains hidden or 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
# https://leetcode.com/problems/generate-parentheses/#/description | |
class Solution(object): | |
def generateParenthesis(self, n): | |
""" | |
:type n: int | |
:rtype: List[str] | |
""" | |
return(self.createParentheses("", n, n)) | |
def createParentheses(self, string, num_open, num_closed): |
This file contains hidden or 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
# https://leetcode.com/problems/letter-combinations-of-a-phone-number/#/description | |
class Solution(object): | |
DIGIT_DICT = { | |
"2" : ['a', 'b', 'c'], | |
"3" : ['d', 'e', 'f'], | |
"4" : ['g', 'h', 'i'], | |
"5" : ['j', 'k', 'l'], | |
"6" : ['m', 'n', 'o'], | |
"7" : ['p', 'q', 'r', 's'], | |
"8" : ['t', 'u', 'v'], |
This file contains hidden or 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
task :convert_textile_to_markdown_extra => :environment do | |
require 'tempfile' | |
Issue.all.each do |version| | |
if (String(version.tracker) == "Approval" && Integer(version.id) > 72400 && Integer(version.id) < 72500) | |
#if (Integer(version.id) == 73293) for testing on specific documents | |
puts 'Converting Issue...' | |
puts version.id | |
puts version.subject |
NewerOlder