+ 2

Security Code Coach

Im currently working on the Security Code Coach challengeā€¦ But I only manage to pass cases 1, 2 and 4 Heres my code: https://code.sololearn.com/cJB5QwxUVDwZ/?ref=app (Please dont just post the solution)

7th Jul 2022, 4:49 PM
Janne
Janne - avatar
3 Answers
+ 1
One situation: When $ is first position, it fails because nearestLower is undefined..
7th Jul 2022, 5:05 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
JayakrishnašŸ‡®šŸ‡³ Oh I overlooked thatā€¦ Thanks! šŸ˜€
7th Jul 2022, 5:48 PM
Janne
Janne - avatar
+ 1
code = input() strip_x = [letter for letter in code if letter != "x"] code_dict = {} for lt in strip_x: code_dict[lt] = strip_x.index(lt) if code_dict['T'] == code_dict['
#x27;] + 1 or code_dict['T'] == code_dict['
#x27;] - 1: print("ALARM") else: print("quiet")
27th Feb 2023, 2:16 AM
Chuks AJ
Chuks AJ - avatar