Sorting photos X69947


Statement
 

pdf   zip

html

Input

The input will consist of 3 lines: - The name of the place visited on the trip. It will be always one word. - A list of the photo files coming from the smartphone cameras, separated by a space - A list of the photo files coming from the reflex camera, separated by a space

Output

The output will be the list of "mv" commands to execute in order to rename all the files. Enrique also wants the list to be ordered by the new file name, so the first command must be the one that converts the oldest photo.

Public test cases
  • Input

    Japan
    IMG_20210613_104512.jpg IMG_20210612_225814.jpg
    P130621_083827.jpg
    

    Output

    mv IMG_20210612_225814.jpg Japan_000.jpg
    mv P130621_083827.jpg Japan_001.jpg
    mv IMG_20210613_104512.jpg Japan_002.jpg
    
  • Input

    Paris
    IMG_20170103_124522.jpg IMG_20170104_113321.jpg IMG_20170107_223749.jpg
    P020117_203138.jpg P030117_052636.jpg
    

    Output

    mv P020117_203138.jpg Paris_000.jpg
    mv P030117_052636.jpg Paris_001.jpg
    mv IMG_20170103_124522.jpg Paris_002.jpg
    mv IMG_20170104_113321.jpg Paris_003.jpg
    mv IMG_20170107_223749.jpg Paris_004.jpg
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    Haskell Python