Day 4 | Borze | C++
- Ayush Mahajan
- Aug 28, 2022
- 1 min read
We are on a streak for the 4th question Today we are solving Borze: https://codeforces.com/contest/32/problem/B… Don't forget to give it a try yourself.
To solve this question I think like this - If we start from the first character, then if it is '.' then the first number cannot be anything other than 0 but if the first two characters are '-.' or '--' then it will be 1 or 2.
But if we have covered one number, then we can follow the same pattern for the rest of the string. For example - ". - . - -" Since the first character is '.', then the number here should be 0 similarly will be after "-." will be 1 and "--" be 2
You can write a simple loop for it (It's okay if the loop does not look that simple, it will be simple soon once you practice more questions) - https://codeforces.com/contest/32/submission/169338301
Today, I really tried a lot to not make any mistakes. Therefore I made two wrong attempts on these https://codeforces.com/contest/32/submission/169337884… and https://codeforces.com/contest/32/submission/169337809… But did you know that for compilation error or Wrong attempt of Test Case 1 is not counted towards penalty in Codeforces?
![Day 44 | Binary Search Practice [Leetcode] | C++](https://static.wixstatic.com/media/fbea2a_167f1b66234f4d30b91bcf5b517f83f3~mv2.jpg/v1/fill/w_980,h_490,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/fbea2a_167f1b66234f4d30b91bcf5b517f83f3~mv2.jpg)
![Day 43 | Graph and Tree Practice [Leetcode] II | C++](https://static.wixstatic.com/media/fbea2a_361d6f7cd90c431b9f25518e1503da94~mv2.jpg/v1/fill/w_980,h_490,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/fbea2a_361d6f7cd90c431b9f25518e1503da94~mv2.jpg)
![Day 42 | Graph Practice [LeetCode] | C++](https://static.wixstatic.com/media/fbea2a_6570bb28577149f19db06704d542789a~mv2.jpg/v1/fill/w_980,h_490,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/fbea2a_6570bb28577149f19db06704d542789a~mv2.jpg)
Comments