+ 5
[SOLVED]C#: Password Rules
Updated: Solved. See link for solution. I am having a difficult time figuring this out. It should be correct, but one of the hidden cases is failing and I don't know why. https://code.sololearn.com/ca34E9MTPFqi/?ref=app
11 ответов
+ 1
TheWh¡teCat 🇧🇬 please disregard. I solved it. I was missing a break statement, so I figured out that the hidden case had multiple invalid symbols.
I can label this as solved now. Updated code will be public for all to see.
+ 1
Chris , in fact I didn't do anything. The second thing I was considering was that with many disallowed symbols it will print many times "Invalid".
+ 1
That's exactly what was happening. I didn't realize this at first because the one failed case was hidden.
0
Chris , provide the full description of the task also exapmple inputs and outputs.
0
Write a program to take the password as input and output "Invalid", if it contains any disallowed symbols.
If the password requirement is satisfied, program shouldn't output anything.
Sample Input
yl1893!dm$
Sample Output
Invalid
0
I cannot tell you the case that is failing because it is hidden. C# 47.2 Practice
0
Chris , is it mentioned the full list of the symbols in the task? It's hard to compare them with this in your code.
0
Yes. The full list of symbols were the ones listed in my code. In any event, it is solved now. Thank you so much for taking a look, though!
0
cheers for this chris. i was struggling with this one myself. turns out my issue was i was trying to use the line
if (password.Contains(notAllowedSymbols))
rather than
if (password.Contains(i))
as in your example.
0
https://code.sololearn.com/cPMkWNlJtRmK/?ref=app
https://code.sololearn.com/cwq4Waeoi5SY/?ref=app
https://code.sololearn.com/W5cA8c0W0So4/?ref=app
https://code.sololearn.com/WP2Axj7ECgSX/?ref=app
https://code.sololearn.com/cbts65Vuvq1j/?ref=app
https://code.sololearn.com/WQIiQlOQbODw/?ref=app
https://code.sololearn.com/W07cScpfBxOx/?ref=app
https://code.sololearn.com/W3Lqf48P97cB/?ref=app
https://code.sololearn.com/c65wW7G5Q9p5/?ref=app
https://code.sololearn.com/cwPJxME21w29/?ref=app
https://code.sololearn.com/W7Uh7s3OxJk7/?ref=app
https://code.sololearn.com/cZJEHc18ufn5/?ref=app
https://code.sololearn.com/cT1yWDZ0d6fR/?ref=app
https://code.sololearn.com/WWHbNzIWt3op/?ref=app
https://code.sololearn.com/Ws4ihzNSoyPd/?ref=app
https://code.sololearn.com/cWQhLwc6YB70/?ref=app
https://code.sololearn.com/W7lrNy4Jc0oj/?ref=app
https://code.sololearn.com/ctZuOD8ubAsc/?ref=app
https://code.sololearn.com/czeTg5sa3i5v/?ref=app
https://code.sololearn.com/WWTg5bhzWSY6/?ref=app
https://code.sololearn.com/WogTtVY04M4w/?ref
0
https://www.sololearn.com/discuss/3064367/?ref=app
https://www.sololearn.com/discuss/3064172/?ref=app
https://www.sololearn.com/discuss/3064682/?ref=app
https://www.sololearn.com/discuss/3064746/?ref=app
https://www.sololearn.com/discuss/3064235/?ref=app
https://www.sololearn.com/discuss/3064809/?ref=app
https://www.sololearn.com/discuss/3064105/?ref=app
https://www.sololearn.com/discuss/3064677/?ref=app
https://www.sololearn.com/discuss/3064546/?ref=app
https://www.sololearn.com/discuss/3064099/?ref=app
https://www.sololearn.com/discuss/3064483/?ref=app
https://www.sololearn.com/discuss/3064160/?ref=app
https://www.sololearn.com/discuss/3064736/?ref=app
https://www.sololearn.com/discuss/3064126/?ref=app
https://www.sololearn.com/discuss/3063998/?ref=app
https://www.sololearn.com/discuss/3064254/?ref=app
https://www.sololearn.com/discuss/3064508/?ref=app
https://www.sololearn.com/discuss/3064380/?ref=app
https://www.sololearn.com/discuss/3064378/?ref=app
https://www.sololearn.com/discuss/3064183/?ref=app
http