Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
first_line = input() while True: line = input() if line == "Travel": break line_split = line.split(":") command = line_split[0] if command == "Add Stop": given_index = int(line_split[1]) new_stop = line_split[2] if 0 <= given_index <= len(first_line): first_line = (first_line[:given_index] + new_stop + first_line[given_index:]) print(first_line) elif command == "Remove Stop": start_idx = int(line_split[1]) end_idx = int(line_split[2]) if 0 <= start_idx <= len(first_line) and 0 <= end_idx <= len(first_line): first_line = (first_line[:start_idx]) + first_line[end_idx + 1:] print(first_line) else: old_stop = line_split[1] new_stop = line_split[2] first_line = first_line.replace(old_stop, new_stop) print(first_line) print(f"Ready for world tour! Planned stops: {first_line}")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)