+ 1
How to continue over a character?
https://code.sololearn.com/cp69KyAH958K/?ref=app How to check if we can get a string from another string. In this example there is one 'a' but we need two. So we can't pass because it takes 'a' two times. It is not correct because we can take it only once.
3 Réponses
+ 1
Hmm, I don't have this as code, but could you destroy the letter when it is found?
Make a duplicate of the target, each time you find a letter from the source in the target, you delete that character place in the target.
Eg: find 'crabby' in Cantebury,
first run finds 'c' at target[0], so replace target[0] with '_', end that run.
2nd run searches for 'r', finds it at target[7], replaces that, ends that run.
...
5th search for 'b', doesn't find it because target[5] is already destroyed. Search fails.
https://code.sololearn.com/cmHYDSam5P6i/?ref=app
+ 1
I have found it, it must be like I do.
0
Hello me again, I tried this program in the other compiler and it prints me wrong result??? I don't know why