We have encoded string.
Instruction for decode:
- Each character of the string is either a letter, or a space, or a dot ".", Or two dots "..".
- If there is a dot after a letter, then we leave the letter unchanged. In this case, the point itself must be deleted.
- If there are two dots after a letter, then the previous character must be erased. In this case, both points must also be deleted.
- It is possible that the message after decryption will be empty. As a result, you can return just an empty string Time complexity: O(log N) where N - length of encode string
Solving the problem using binary search.
Time complexity: O(log N)
Flask app to find pivot point in shifted and sorted array Time complexity: O(log N)
Module can:
- create binary tree of any height
- walk binary tree and save steps of walking in log file "walk_log.txt"
- restore_tree from "walk_log.txt" file and print root