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.)
I chose to work my solutions with Python
Part 1: ion_flux_relabeling
Part 2: hey-i-already-did-that:
.. If the algorithm reaches a constant, such as 0, then the length is 1.