Skip to main content

google-foobar-2023-q4

Production

Installation

# https://replit.com/@jasonchan51/hychan48-google-foobar-2023-q4
pipx install hychan48-google-foobar-2023-q4

hychan48-cake-is-not-a-lie --help
hychan48-cake-is-not-a-lie abab
hychan48-dont-get-volunteered 0 1

Level 1

hychan48-cake-is-not-a-lie abab

# GitHub action runs the PyTests:
pytest levels/q1/tests/solutions_test.py
# JavaScript solution
pnpm run test:q1

level 2

Question 1

hychan48-dont-get-volunteered 0 1 # Returns 3
pytest ./levels/q2/tests/solutions_bfs_test.py

Background

Assumptions

  • So far it looks like it's either Python 2.7 or Java 8
  • I'm going to use Python 3.11.6, using basic syntax it should be backwards compatible with 2.7
    • Also, I have PyCharm installed already
  • TDD with PyTest

Quick Checklist

  • Documentation
    • Save Original Question
      • /api/v1/files/ (.json)
      • convert to .yaml and .html
    • Reword Question and Keywords
      • readme_q.template.md
    • Principles
      • TDD
      • Quick and dirty
        • Unless the question piques my research interest
        • 7 days per question seems like a lot of time
    • Priorities
    • JSDoc @typedef but for Python
    • Metadata
      • Author
      • GitHub Repo
      • Environment
      • Time / Space Complexity (if applicable)
  • Validation / Error handling
  • Test cases / Unit Tests
    • Workflow with GitHub actions
      • Lint - Flake8
      • Unit Tests - PyTest

dev setup

# there's also some helpers
conda activate ./venv

# newer method

# pull
# bats installs differently? weird
# mostly for bats
git pull --recurse-submodule

## bats clones to test/ by default
# 

# first time
# pipx / conda(mamba) / poetry

git submodule add https://github.com/bats-core/bats-core.git test/bats
git submodule add https://github.com/bats-core/bats-assert.git test/test_helper/bats-assert
git submodule add https://github.com/bats-core/bats-support.git test/test_helper/bats-support
git commit -m 'Add bats-support library'

tree test/bats/bin
mkdir -p ~/.local/bin
rm ~/.local/bin/bats
ln -s $PWD/test/bats/bin/bats ~/.local/bin/bats 
ln -s $PWD/test/bats/bin/bats /usr/local/bin/bats
ln -s ./test/bats/bin/bats /usr/local/bin/bats
ls -l /usr/local/bin/bats
bats
export PATH=$PATH:~/.local/bin

# git submodule add https://github.com/ztombol/bats-support test/test_helper/bats-support
# cygwin / windows 11
pnpm i
# haha didnt work:
conda create -n foobar-py27 python=2.7
conda create -n google-foorbar-2023-q4 python=3.11

conda activate google-foorbar-2023-q4

# update pipx
pipx --version
python -m pip install --user pipx
python -m pipx ensurepath

# poetry... too basic to need it... todo: move to other section
# might not be needed after all...
pipx install poetry
poetry --version
poetry init

# poetry might not be needed after all...
poetry add pytest --group dev
#poetry shell
# 3.11.4 vs 3.11.6... interesting

Install pytest

conda activate google-foorbar-2023-q4
python -m pip install pytest

python -m pip install -r requirements.txt

Appendix

Release files for hychan48-google-foobar-2023-q4 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hychan48-google-foobar-2023-q4 0.2.2
File Size Uploaded
hychan48_google_foobar_2023_q4-0.2.2.tar.gz 54.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hychan48-google-foobar-2023-q4 0.2.2
File Interpreter ABI Platform
hychan48_google_foobar_2023_q4-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 116.6 kB

Release files / hychan48_google_foobar_2023_q4-0.2.2.tar.gz

Download URL hychan48_google_foobar_2023_q4-0.2.2.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fb1f37f479f1cc2cfd5c943285b1949751f18d18a09d1ab703863127452b0801
BLAKE2b-256 checksum
How to use checksums
5948dba878fa30b9e94689df5f3842fc3b99afdf0e817ee17454ca82e19914a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / hychan48_google_foobar_2023_q4-0.2.2-py3-none-any.whl

Download URL hychan48_google_foobar_2023_q4-0.2.2-py3-none-any.whl
Size 62.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f6d5cda6811abdc8bfb3c613a2ed43e734e3f82d03268ff7017c100331d852b
BLAKE2b-256 checksum
How to use checksums
d26939629a1a5c736036b626c08a6b7b1b78c7e690006a2c9c9cddcd3a38c25c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page