Skip to content

Instantly share code, notes, and snippets.

View big-bo99's full-sized avatar

Baurzhan big-bo99

View GitHub Profile
@big-bo99
big-bo99 / train_problem.py
Created October 27, 2023 07:15
Opvia Train Breakfast Problem
total_ingredients = 327
total_passengers = 100
left = 0 # left boundary
right = 70 # right boundary == Maximum number of full-english plates
while left < right:
# potential amount of full-english plates
mid = (right - left) // 2 + left
# amount of ingeridients left after forming full-english plates
@big-bo99
big-bo99 / rainforest_challenge.py
Created September 19, 2023 07:18
Rainforest application challenge
import requests
import logging
# Print info level logs to stdout
logging.basicConfig(level=logging.INFO)
# Set variables
url = "https://letsrevolutionizetesting.com/challenge"
headers = {"Accept": "application/json"}
requests_counter = 0
# How much time have I spent, end-to-end?
# 2,5h
# How many submissions did it take to fully solve it?
# I did not came up with a working solution myself
# What were the trickiest aspects? Where did you lose the most time?
# How much time have I spent, end-to-end?
# 1h 30min
# How many submissions did it take to fully solve it?
# * Not counting basic tests submissions(more than 7)
# 1. My first BruteForce DFS+recursion was failing basic tests {recursion/memory limit}
# 2. For MinHeap solution it took me 2 submission.
# How much time have I spent, end-to-end?
# 2,5 hours to get an optimal working solution. 40 more minutes to make it clear and add comments
# What were the trickiest aspects? Where did you lose the most time?
# 1. Dealing with nested brackets
# 2. At first, started traversing the formula from the beginning. After coding a draft version, understood that handling nested brackets this way is tricky, so I changed the traverse direction
# 3. Later from test cases found out that:
# - Element might consist of more than 2 characters
import math
class Solution:
def smallestRange(self, nums: List[List[int]]) -> List[int]:
answer_range = (None, None)
listsCount = len(nums)
# Pointers to iterate over each separate list
pointers = [0] * listsCount
# Max value out of list 1 values
range_max = max(row[0] for row in nums)
Jan 28 15:58:18 InnoMiner kernel: Booting Linux on physical CPU 0x0
Jan 28 15:58:18 InnoMiner kernel: Linux version 4.14.0-inno-g5a6bef0 (luozl@localhost.localdomain) (gcc version 6.1.1 20160711 (Linaro GCC 6.1-2016.08)) #523 PREEMPT Mon Nov 11 15:40:07 CST 2019
Jan 28 15:58:18 InnoMiner kernel: CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c53c7d
Jan 28 15:58:18 InnoMiner kernel: CPU: div instructions available: patching division code
Jan 28 15:58:18 InnoMiner kernel: CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Jan 28 15:58:18 InnoMiner kernel: Machine: Logmicro Soc
Jan 28 15:58:18 InnoMiner kernel: Ignoring memory below PHYS_OFFSET: 0x00000000-0x00000000
Jan 28 15:58:18 InnoMiner kernel: Memory policy: Data cache writeback
Jan 28 15:58:18 InnoMiner kernel: cma: Reserved 16 MiB at 0x8f000000
Jan 28 15:58:18 InnoMiner kernel: On node 0 totalpages: 65536

Keybase proof

I hereby claim:

  • I am big-bo99 on github.
  • I am big_bo99 (https://keybase.io/big_bo99) on keybase.
  • I have a public key ASBGoMY0VzbzwDo94PEdiG4TUD_Tkuekp4Y_Nv4fyE8jWgo

To claim this, I am signing this object:

[2020-07-23 06:11:13] local.ERROR: Connection refused [tcp://127.0.0.1:6379] {"userId":4095,"exception":"[object] (Predis\\Connection\\ConnectionException(code: 111): Connection refused [tcp://127.0.0.1:6379] at /var/www/vendor/predis/predis/src/Connection/AbstractConnection.php:155)
[stacktrace]
#0 /var/www/vendor/predis/predis/src/Connection/StreamConnection.php(128): Predis\\Connection\\AbstractConnection->onConnectionError('Connection refu...', 111)
#1 /var/www/vendor/predis/predis/src/Connection/StreamConnection.php(178): Predis\\Connection\\StreamConnection->createStreamSocket(Object(Predis\\Connection\\Parameters), 'tcp://127.0.0.1...', 4)
#2 /var/www/vendor/predis/predis/src/Connection/StreamConnection.php(100): Predis\\Connection\\StreamConnection->tcpStreamInitializer(Object(Predis\\Connection\\Parameters))
#3 /var/www/vendor/predis/predis/src/Connection/AbstractConnection.php(81): Predis\\Connection\\StreamConnection->createResource()
#4 /var/www/vendor/predis/predis/src/Connection/StreamConnection
Problem 1
- Installation request for laravel/framework 5.5 -> satisfiable by laravel/framework[v5.5.0].
- Conclusion: remove phpunit/phpunit 4.8.31
- Conclusion: don't install phpunit/phpunit 4.8.31
- laravel/framework v5.5.0 requires symfony/var-dumper ~3.3 -> satisfiable by symfony/var-dumper[3.3.x-dev, 3.4.x-dev, v3.3.0, v3.3.0-BETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.3, v3.4.30, v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37, v3.4.38, v3.4.39, v3.4.4, v3.4.40, v3.4.41, v3.4.42, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9].
- symfony/var-dumper 3.3.x-dev conflicts