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
function fullJustify(words: string[], maxWidth: number): string[] { | |
let result: string[] = []; | |
let currentLineLength: number = 0; | |
let currentLineWords: string[] = []; | |
let currentSpaces: number = 0; | |
for (let i = 0; i < words.length; i++) { | |
currentLineWords.push(words[i]); | |
currentSpaces = currentLineWords.length - 1; | |
currentLineLength += words[i].length; |
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 Node: | |
def __init__(self, location: list[int] = None): | |
self.location = location | |
self.north: Node = self | |
self.east: Node = self | |
self.south: Node = self | |
self.west: Node = self | |
class Solution: |