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
from itertools import permutations, groupby | |
width = 0 | |
def solution(times, time_limit): | |
global width | |
width = len(times) | |
numBunnies = width - 2 | |
full = [i for i in range(width)] | |
fullBunnies = full[:-2] | |
fullBunniesIndex = [i+1 for i in fullBunnies] | |
if(negativeCycles(times)): |
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 math | |
def solution(map): | |
searchMap = [] | |
searchMap.append((0,0,0)) | |
moves = 0 | |
finished = False | |
while not finished: | |
[searchMap, finished] = search(searchMap, map) | |
moves += 1 | |
return moves |