[pre-commit.ci] pre-commit autoupdate (#11322)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2024-03-13 07:52:41 +01:00
committed by GitHub
parent 5f95d6f805
commit bc8df6de31
297 changed files with 488 additions and 285 deletions

View File

@ -2,6 +2,7 @@
Program to list all the ways a target string can be
constructed from the given list of substrings
"""
from __future__ import annotations

View File

@ -8,6 +8,7 @@ We have N tasks and M people. Each person in M can do only certain of these task
a person can do only one task and a task is performed only by one person.
Find the total no of ways in which the tasks can be distributed.
"""
from collections import defaultdict

View File

@ -4,6 +4,7 @@
This program calculates the nth Fibonacci number in O(log(n)).
It's possible to calculate F(1_000_000) in less than a second.
"""
from __future__ import annotations
import sys

View File

@ -5,6 +5,7 @@ You are given a bitmask m and you want to efficiently iterate through all of
its submasks. The mask s is submask of m if only bits that were included in
bitmask are set
"""
from __future__ import annotations

View File

@ -10,6 +10,7 @@ return it.
Example: [10, 22, 9, 33, 21, 50, 41, 60, 80] as input will return
[10, 22, 33, 41, 60, 80] as output
"""
from __future__ import annotations

View File

@ -38,6 +38,7 @@ Example input:
arr = [40, 20, 30, 10, 30]
output: 26000
"""
from collections.abc import Iterator
from contextlib import contextmanager
from functools import cache

View File

@ -9,6 +9,7 @@ subarray sum problem in O(n) time and O(1) space.
Reference: https://en.wikipedia.org/wiki/Maximum_subarray_problem
"""
from collections.abc import Sequence