+ 1
Improve and simplify YouTube link finder
Hi! I'm a beginner, but this medium code coach solved easily enough. Is there a way to simplify and improve my code? https://code.sololearn.com/c8rdEG4FMnX1/?ref=app
4 Antworten
+ 3
Have one line of code search backward from the end of the input string for either '=' or '/', then in the next line print everything after that location to the end of the string.
+ 2
In business I would use regex, but in this challenge I shamelessly exploited that the id is at the end and has constant length. This is my solution in python:
print(input()[-11:])
+ 2
Wow! Thanks!
+ 1
Ahahah, that's awesome