Skip to content

Commit

Permalink
Solve Upset Link in python
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Dec 27, 2023
1 parent c4e9255 commit 12450b7
Show file tree
Hide file tree
Showing 6 changed files with 884 additions and 0 deletions.
25 changes: 25 additions & 0 deletions solutions/beecrowd/2651/2651.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sys

zelda_letters = [
['z', 'Z'],
['e', 'E'],
['l', 'L'],
['d', 'D'],
['a', 'A'],
]

for line in sys.stdin:
index = 0
for char in line:
if char in zelda_letters[index]:
index += 1
else:
index = 0
if char in zelda_letters[index]:
index += 1

if index == 5:
print("Link Bolado")
break
else:
print("Link Tranquilo")
33 changes: 33 additions & 0 deletions solutions/beecrowd/2651/generate_in.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -euo pipefail

TESTCASES=400
ALPHABET=({a..z} {A..Z})
UPPER_ZELDA=(Z E L D A)
LOWER_ZELDA=(z e l d a)

for _ in $(seq "${TESTCASES}"); do
if [[ $((RANDOM % 2)) -eq 0 ]]; then
for _ in $(seq "$((RANDOM % 20 + 1))"); do
echo -n "${ALPHABET[$((RANDOM % 52))]}"
done
fi
for i in {0..4}; do
if [[ $((RANDOM % 6)) -gt 0 ]]; then
if [[ $((RANDOM % 2)) -gt 0 ]]; then
echo -n "${UPPER_ZELDA[${i}]}"
else
echo -n "${LOWER_ZELDA[${i}]}"
fi
else
echo -n "${ALPHABET[$((RANDOM % 52))]}"
fi
done
if [[ $((RANDOM % 2)) -eq 0 ]]; then
for _ in $(seq "$((RANDOM % 20 + 1))"); do
echo -n "${ALPHABET[$((RANDOM % 52))]}"
done
fi
echo
done
Loading

0 comments on commit 12450b7

Please sign in to comment.