Skip to content

mariajdab/foobar-with-google

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Foobar challenges and solutions

I was searching in Google for something related to Python optimization and I got an unexpected invitation to a challenge that appeared to be very unusual...

but, with my insatiable curiosity I accepted it, of course :)

Later, I realized it's a programming challenge by Google that people can get based on their search history or by a friend invitation. Here, I would like to share the interesting problems that I encountered and my solutions to them.

A bit of context:

After accepting the invitation and linking it with my email account, I saw some kind of terminal emulator. Typing "help" gave me access to all the information I needed to get started. For example, to get a challenge, I needed to type "request" then automatically I will have a folder in the workspace, the name of the folder will be the challenge's name and something important to point out is that after requesting the challenge the timer starts to run. You can see it in the image below, there I already had requested the challenge.

The firts challenge (level 1) was: the-cake-is-not-a-lie.

If I move to the challenge folder I was able see some files:

  • readme.txt (Typing "cat readme.txt" to see the challenge)
  • constraints.txt (Where to see the limitations.)
  • solution.py (Where Python code solution will be stored.)
  • Solution.java (Where Java code solution will be stored.)

Constraints

I chose to work my solutions with Python

solution.py



Challenge level 1: the-cake-is-not-a-lie

Time: 48 hours to solve it.



Challenge level 2

Part 1: ion_flux_relabeling

Time: 72 hours to solve it



Part 2: hey-i-already-did-that:

.. If the algorithm reaches a constant, such as 0, then the length is 1.

Challenge level 3