Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
378 views

Google Foobar challenge optimization

I am trying to solve Google Foobar challenge prepare-the-bunnies-escape using my own approach, instead of BFS. I attempt to solve two ends of the maze and try to ...
ScriptKidd's user avatar
8 votes
3 answers
2k views

A* (shortest path) with the ability to remove up to one wall

Problem You are given an HxW matrix. Each element is either 0 (passable space) or 1 (wall). Given that you can remove one wall, find the shortest path from [0,0] (start) to [width-1, height-1] (end). ...
Martin's user avatar
  • 183
7 votes
2 answers
3k views

Find the closest enemy in a 2D grid with wrapping allowed

I'd like feedback on my solution to the outlined programming challenge. Is numpy a good candidate module for this? What might be a more efficient or Pythonic solution? Closest Enemy II Have the ...
Dave's user avatar
  • 753
7 votes
2 answers
6k views

Find the correct path through a 5 x 5 grid (coderbyte 'Correct path')

I've completed the following coderbyte question and would like feedback as to whether it follows Python best practices, is efficient and so forth. The coderbyte problem: Have the function ...
Dave's user avatar
  • 753
2 votes
0 answers
232 views

Codewars: Remote Control Virtual Keyboard

This is my solution to the Codewars problem TV Remote (symbols). Description In short, you are given a virtual keyboard with 3 modes between which can be switched by pressing the ...
Failware's user avatar
7 votes
1 answer
2k views

Python program to find a word ladder transforming "four" to "five"

I saw this Puzzling problem and thought I would try to write a Python program to solve it. The task is to transform "four" to "five", forming a new four-letter word at each step, replacing one letter ...
Alex F's user avatar
  • 443
2 votes
0 answers
190 views

Project Euler #81 in Haskell: minimal path sum through a matrix

I just completed Project Euler Problem 81 in Haskell: In the 5 by 5 matrix below, ...
castle-bravo's user avatar
13 votes
1 answer
6k views

Google FooBar "Prepare The Bunnies Escape"

I'm currently working through the google FooBar challenge, and I'm on the third level, in which I have to find the distance between the top left and bottom right points on a grid. The grid is filled ...
Isaac-Neil Zanoria's user avatar
4 votes
1 answer
12k views

Simple maze solving algorithm

I was to write a simple maze solver program that takes in an input file denoting the maze start and end points, and the structure of the maze itself. The specifications were to keep it as simple as ...
Eoin's user avatar
  • 263
14 votes
3 answers
7k views

Maze solver and generator in Python

After watching Computerphile's video I decided to create my own maze solver and generator in Python. I've never written anything in Python so I'd like to get some feedback about my code, specifically ...
thjisisibot's user avatar
3 votes
0 answers
232 views

Codingame: Great Escape bot in Ruby - Follow-up

This is a follow-up to Codingame: Great Escape bot in Ruby. As mentioned there, my first reasonably sized Ruby project is a bot for CodinGame's Great Escape contest (here is a sample gameplay video). ...
Mangara's user avatar
  • 475
6 votes
2 answers
431 views

Codingame: Great Escape bot in Ruby

(EDIT: I incorporated a lot of the feedback from the answers, and posted a follow-up question here: Codingame: Great Escape bot in Ruby - Follow-up) I started working on some code challenges at ...
Mangara's user avatar
  • 475
2 votes
1 answer
1k views

Google Foobar challenge: Exiting a space station maze, where one wall may be removed

I'm solving Foobar challenge. My code runs perfectly in eclipse but when i verify it on foobar it says Execution took too long . The question is - You have maps of parts of the space station, each ...
Savan's user avatar
  • 31
4 votes
1 answer
151 views

Path Finder Maze

The goal of my code was to find all possible moves from each open position in the maze (@moves_hash), assign it a value for how many moves it would take to get to ...
kobetastic's user avatar
11 votes
1 answer
6k views

Find the shortest path through a maze with a twist: you can knock down one wall

I would like my solution to Google Foobar's prepare_the_bunnies_escape checked for readability, maintainability, extensibility, style, design. I am looking forward ...
josfervi's user avatar
  • 167

15 30 50 per page