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
class Solution: | |
def flipAndInvertImage(self, A): | |
""" | |
:type A: List[List[int]] | |
:rtype: List[List[int]] | |
""" | |
def invert(value): | |
if value==1: | |
return 0 | |
else: |
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
class Solution: | |
def maxIncreaseKeepingSkyline(self, grid): | |
""" | |
:type grid: List[List[int]] | |
:rtype: int | |
""" | |
# return skyline from Top or Bottom | |
def fromTop(grid): | |
listhori = [] |
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
class Solution: | |
def findWords(self, words): | |
""" | |
:type words: List[str] | |
:rtype: List[str] | |
""" | |
# judge which row the input char belongs to | |
def judgeRow(c): | |
row1 =['q','w','e','r','t','y','u','i','o','p','Q','W','E','R','T','Y','U','I','O','P'] | |
row2 =['a','s','d','f','g','h','j','k','l','A','S','D','F','G','H','J','K','L'] |