Skip to main content

All Questions

8votes
2answers
6kviews

BFS shortest path for Google Foobar "Prepare the Bunnies' Escape"

This is the Google Foobar puzzle "Prepare the Bunnies' Escape": You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map ...
oxtay's user avatar
4votes
1answer
408views

Counting ways to fit bottles in crates

I'm calculating how many possibilities there are to fit \$n\$ identical bottles inside \$k\$ crates of various capacities. n = Number of bottles k = Number of crates K = List of the number of bottles ...
Deniz Alz's user avatar
18votes
5answers
3kviews

Flipping coins performance

This is the Flipping coins problem on CodeChef: There are \$N\$ coins kept on the table, numbered from \$0\$ to \$N - 1\$. Initially, each coin is kept tails up. You have to perform two types of ...
Ukiyo's user avatar
13votes
5answers
9kviews

"Algorithmic Crush" problem hitting timeout errors

This is the HackerRank problem Algorithmic Crush: You are given a list of size N, initialized with zeroes. You have to perform ...
enthusiastic's user avatar
10votes
5answers
869views

Minimum perfect squares needed to sum up to a target

I'm trying to solve this problem Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. I've come up with a solution that works ...
nz_21's user avatar
  • 1,051
8votes
1answer
17kviews

Shortest Path For Google Foobar (Prepare The Bunnies Escape)

I have been working on Google Foobar since a few days ago. I am currently in the third level but is stuck in the second challenge of "Prepare the Bunnies' Escape." I have checked this post but it did ...
Sean Francis N. Ballais's user avatar
7votes
2answers
7kviews

Google FooBar XOR Checksum Challenge

Google FooBar came up a few days ago and I took it as a challenge to learn python quickly while having fun. However, I ran into one challenge today that has left me stumped, I've come up with a ...
RoflcopterV RoflcopterV's user avatar
7votes
1answer
2kviews

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
6votes
1answer
2kviews

MaxCounters solution

I am doing this Codility problem You are given N counters, initially set to 0, and you have two possible operations on them: increase(X) − counter X is increased by 1, max counter − all ...
Sidharth Samant's user avatar
6votes
2answers
6kviews

BFS shortest path for Google Foobar challenge "Prepare the Bunnies' Escape"

This is the Google Foobar challenge "Prepare the Bunnies' Escape": You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is ...
Devflovv's user avatar
6votes
3answers
2kviews

Project Euler 92: Square digit chains

A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 → 32 → 13 → 10 → 1 → 1 85 → ...
N3buchadnezzar's user avatar
4votes
1answer
1kviews

FirstDuplicate Finder

I read the solution to this question, which seems to be the same target. My solution is (I'm sure) not the quickest, but some test case is apparently taking longer than 4s. I did a test case with 10,...
jlehenbauer's user avatar
4votes
1answer
152views

Find the number of substrings of a numerical string greater than a given num string

Question: http://qa.geeksforgeeks.org/9744/vinay-queried-interesting-problem-optimization Input The first line contains N denoting the length of Target String. This line is followed by the ...
sandesh indavara's user avatar
3votes
2answers
960views

Project Euler #12 runs very slowly

The problem is : The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1,...
help needed's user avatar
3votes
2answers
217views

CodeChef PRIME1 problem in Python

PRIME1 is a CodeChef problem which states: Shridhar wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all prime numbers between two given numbers. ...
mradul dubey's user avatar

153050per page
close