My solutions, using Python language, to three Kattis problems. The programs use key concepts in Python programming for beginners, such as string manipulation, lists, and loops.
- Run-Length Encoding, Run!: A program that encode/decodes a line of text following the run-length compression scheme.
When encoding a text string, repeated consecutive characters are replaced by a single instance of that character and the number of occurrences of that character (the character’s run length). Decoding the encoded string results in the original string by repeating each character the number of times encoded by the run length.
- Cudoviste: A program that checks the possible parking slots (2x2 cells) from any input map by calculating the number of cars that will be squashed for parking spaces.
- Backspace: A program that fixes the backspace error of the text editor, by deleting the "<" character and its preceding character in a line of text.
The three programs included in this repository provide corresponding solutions to each of the listed problems above.
I solved these problems by myself. The total amount of time I spent on each problem, including reading prompt, writing and fixing codes, and proofreading/formatting, is as follow:
- Problem #1 - Run-Length Encoding, Run!: 1.5 hours
- Problem #2 - Cudoviste: 2.5 hours
- Problem #3 - Backspace: 45 minutes
Any comments on the programs or feedback to improve my logics are welcomed!