Символ не из ASCII в nrzi_encoding.clj

Open
#1,093 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
clojure, cpp
Domain
testing-qa

Research direction

Start with nrzi_encoding.clj and reproduce the reported C++ case containing the non-ASCII character ¯, comparing the resulting character values and string length with the expected behavior. Done means this input is handled without the reported length increase and the relevant behavior is covered by an appropriate check.

Written by the indexing model from the issue text.

Description

При попытке решить задачу на C++ происходит UB, так как каждый символ '¯' трансформируется в два символа char(-62) и char(-81), из-за чего длина строки увеличивается на количество символов '¯' и, как следствие, правильное решение не работает.

Код:

Image

Вывод:

Image

Image

Image

Dominant language
Clojure
Stars
71
Forks
67
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hexlet-codebattle/battle_asserts

All issues in hexlet-codebattle/battle_asserts

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.