Statistics

Problem Statement for "BrokenElevator"

Problem Statement

The elevator in your house is broken, so you need to use stairs to get to different places. Now you want to know how long it will take to get from one location in your house to another one. You will be given the plan of your house as a String[]. All elements with even indices (elements 0, 2, 4, ...) will represent the floors of the building. Each '#' character represents a piece of the floor, and the characters 'S' and 'F' represent your starting position and your destination, respectively. All elements with odd indices will represent the area between floors. The '|' character represents a set of stairs, and the '.' character represents an empty space. You can only move from one floor to another floor by going up or down a set of stairs. There will only be one set of stairs between each pair of consecutive floors. You spend one second to move one floor down, two seconds to move one step left or right and three seconds to move one floor up. You are to return the minimal time you need to get from the starting position to the finish. For example, for the following plan:
#S###
...|.
#####
.|...
####F
the optimal path will consist of two steps to the right, moving 1 floor down, two steps to the left, moving 1 floor down and finally three steps to the right. The total time spent is 2*2 + 1*1 + 2*2 + 1*1 + 3*2 = 16 seconds.
First element represents the topmost floor.

Definition

Class:
BrokenElevator
Method:
wayTime
Parameters:
String[]
Returns:
int
Method signature:
int wayTime(String[] plan)
(be sure your method is public)

Constraints

  • plan will contain between 1 and 49 elements, inclusive.
  • plan will contain an odd number of elements.
  • Each element of plan will contain between 1 and 50 characters, inclusive.
  • Each element of plan will contain the same number of characters.
  • Elements of plan with even indices (0-based) will contain only the characters '#', 'S', and 'F'.
  • Elements of plan with odd indices will contain only the characters '.' and '|'.
  • Each element of plan with an odd index will contain exactly one '|'.
  • plan will contain exactly one 'S' and exactly one 'F'.

Examples

  1. {"#S###","...|.","#####",".|...","####F"}

    Returns: 16

    The example from the statement.

  2. {"#F###","...|.","#####",".|...","####S"}

    Returns: 20

    The optimal path contains 3 steps to the left (6 seconds), moving 1 floor up (3 seconds), two steps to the right (4 seconds), moving another 1 floor up (3 seconds) and 2 steps to the left (4 seconds).

  3. {"SF"}

    Returns: 2

    Just one step to the right

  4. {"FS"}

    Returns: 2

  5. {"F", "|", "S"}

    Returns: 3

  6. {"FS","|.","##"}

    Returns: 2

  7. {"###",".|.","###","|..","###","..|","S#F",".|.","###","|..","###","|..","###",".|.","###"}

    Returns: 4

  8. {"####","...|","####","|...","####",".|..","####","...|","F#S#"}

    Returns: 4

  9. {"#####","..|..","#####","|....","#####","..|..","F#S##","|....","#####","|....","#####","|....","#####"}

    Returns: 4

  10. {"######","..|...","SF####","....|.","######","...|..","######","..|...","######",".....|","######"}

    Returns: 2

  11. {"#######","....|..","#######","...|...","#######","....|..","#######","|......","#S#F###","....|..","#######"}

    Returns: 4

  12. {"########","......|.","########","....|...","########","......|.","########",".......|","#FS#####",".....|..","########",".....|..","########","|.......","########","..|.....","########"}

    Returns: 2

  13. {"#########","....|....","#########","...|.....","###FS####","........|","#########",".......|.","#########"}

    Returns: 2

  14. {"##########","......|...","##########",".|........","##########",".......|..","##########",".........|","##F###S###","..|.......","##########",".|........","##########",".|........","##########"}

    Returns: 8

  15. {"###########","......|....","###########",".|.........","#######FS##",".........|.","###########",".........|.","###########","......|....","###########","..........|","###########"}

    Returns: 2

  16. {"##################################################",".|................................................","##################################################","........................................|.........","##################################################",".................|................................","############################F###################S#",".................................................|","##################################################"}

    Returns: 40

  17. {"#################################################","..................|..............................","#################################################","..........................................|......","#################################################","|................................................","#################################################","............................|....................","####################F##############S#############","......................|..........................","#################################################",".....................................|...........","#################################################"}

    Returns: 30

  18. {"################################################","........................................|.......","################################################","...............|................................","######F##############S##########################","...|............................................","################################################"}

    Returns: 30

  19. {"###############################################",".......|.......................................","###############################################","...............|...............................","####S#####################F####################","....................|..........................","###############################################"}

    Returns: 44

  20. {"################S#F###########################",".....................|........................","##############################################","............|.................................","##############################################"}

    Returns: 4

  21. {"#############################################","..........................|..................","F###########S################################","...............................|.............","#############################################","..........................................|..","#############################################","...........................................|.","#############################################"}

    Returns: 24

  22. {"############################################","...............................|............","#############F############S#################","..........................................|.","############################################",".....................................|......","############################################",".|..........................................","############################################"}

    Returns: 26

  23. {"###########################################","...............................|...........","###########################################","........................|..................","#############F###########S#################"}

    Returns: 24

  24. {"##########################################",".....................................|....","##########################################","....|.....................................","##########################################","..|.......................................","#########F#######################S########",".|........................................","##########################################","....|.....................................","##########################################"}

    Returns: 48

  25. {"#########################################","...|.....................................","########F########S#######################","........................|................","#########################################",".................................|.......","#########################################","|........................................","#########################################","..............................|..........","#########################################"}

    Returns: 18

  26. {"F##############################################","..|............................................","S##############################################","........................|......................","###############################################","...........................................|...","###############################################","|..............................................","###############################################",".............................|.................","###############################################","....|..........................................","###############################################","........................................|......","###############################################","..............................|................","###############################################",".|.............................................","###############################################"}

    Returns: 11

  27. {"##############################################F","..|............................................","S##############################################","........................|......................","###############################################","...........................................|...","###############################################","|..............................................","###############################################",".............................|.................","###############################################","....|..........................................","###############################################","........................................|......","###############################################","..............................|................","###############################################",".|.............................................","###############################################"}

    Returns: 95

  28. {"##################################S############","..|............................................","###############F###############################","........................|......................","###############################################","...........................................|...","###############################################","|..............................................","###############################################",".............................|.................","###############################################","....|..........................................","###############################################","........................................|......","###############################################","..............................|................","###############################################",".|.............................................","###############################################"}

    Returns: 91

  29. {"F##############################################","..|............................................","#######################S#######################","........................|......................","###############################################","...........................................|...","###############################################","|..............................................","###############################################",".............................|.................","###############################################","....|..........................................","###############################################","........................................|......","###############################################","..............................|................","###############################################",".|.............................................","###############################################"}

    Returns: 49

  30. {"F#############","...|..........","S#############","............|.","##############"}

    Returns: 15

  31. {"#############F","...|..........","S#############","............|.","##############"}

    Returns: 29

  32. {"#############S","...|..........","#############F","............|.","##############"}

    Returns: 41

  33. {"####F#########","...|..........","###S##########","............|.","##############"}

    Returns: 5

  34. {"#############################",".........................|...","#############################",".............|...............","#############################",".................|...........","#############################","............|................","#############################","............|................","#############################","..............|..............","F############################",".................|...........","#############################",".|...........................","#############################","............|................","#############################","...|.........................","#############################","...............|.............","S############################",".................|...........","#############################","..|..........................","#############################"}

    Returns: 175

  35. {"#############################",".........................|...","#############################",".............|...............","#############################",".................|...........","#############################","............|................","#############################","............|................","#############################","..............|..............","############################F",".................|...........","#############################",".|...........................","#############################","............|................","#############################","...|.........................","#############################","...............|.............","S############################",".................|...........","#############################","..|..........................","#############################"}

    Returns: 163

  36. {"#############################",".........................|...","#############################",".............|...............","#############################",".................|...........","#############################","............|................","#############################","............|................","#############################","..............|..............","###########S#################",".................|...........","#############################",".|...........................","#############################","............|................","#############################","...|.........................","#############################","...............|.............","########################F####",".................|...........","#############################","..|..........................","#############################"}

    Returns: 131

  37. {"#############################",".........................|...","#############################",".............|...............","#############################",".................|...........","#############################","............|................","#############################","............|................","#############################","..............|..............","##############F##############",".................|...........","#############################",".|...........................","#############################","............|................","#############################","...|.........................","#############################","...............|.............","######S######################",".................|...........","#############################","..|..........................","#############################"}

    Returns: 135

  38. {"S###################","........|...........","####################",".........|..........","####################",".|..................","####################","|...................","####################","..............|.....","F###################","|...................","####################",".......|............","####################","..............|.....","####################","................|...","####################","..........|.........","####################"}

    Returns: 97

  39. {"S###################","........|...........","####################",".........|..........","####################",".|..................","####################","|...................","####################","..............|.....","###################F","|...................","####################",".......|............","####################","..............|.....","####################","................|...","####################","..........|.........","####################"}

    Returns: 79

  40. { "###############S####", "........|...........", "####################", ".........|..........", "####################", ".|..................", "####################", "|...................", "####################", "..............|.....", "###############F####", "|...................", "####################", ".......|............", "####################", "..............|.....", "####################", "................|...", "####################", "..........|.........", "####################"}

    Returns: 69

  41. {"#########F##########","........|...........","####################",".........|..........","####################",".|..................","####################","|...................","####################","..............|.....","##############S#####","|...................","####################",".......|............","####################","..............|.....","####################","................|...","####################","..........|.........","####################"}

    Returns: 65

  42. {"#############################################",".......................................|.....","F############################################",".....|.......................................","#############################################","...........|.................................","#############################################",".......................|.....................","#############################################","........................|....................","#############################################","......................................|......","############################################S","...................................|.........","#############################################"}

    Returns: 103

  43. {"#############################################",".......................................|.....","############################################F",".....|.......................................","#############################################","...........|.................................","#############################################",".......................|.....................","#############################################","........................|....................","#############################################","......................................|......","############################################S","...................................|.........","#############################################"}

    Returns: 171

  44. {"#############################################",".......................................|.....","#####################S#######################",".....|.......................................","#############################################","...........|.................................","#############################################",".......................|.....................","#############################################","........................|....................","#############################################","......................................|......","###############F#############################","...................................|.........","#############################################"}

    Returns: 149

  45. {"#############################################",".......................................|.....","################F############################",".....|.......................................","#############################################","...........|.................................","#############################################",".......................|.....................","#############################################","........................|....................","#############################################","......................................|......","###########################################S#","...................................|.........","#############################################"}

    Returns: 113

  46. {"##########################################","........|.................................","##########################################","................................|.........","##########################################","...........................|..............","##########################################",".................................|........","##########################################",".|........................................","##########################################","...........|..............................","##########################################",".........................................|","##########################################","........|.................................","##########################################","................|.........................","F#########################################","...................................|......","##########################################",".........................|................","##########################################","............|.............................","##########################################","...................|......................","##########################################","......|...................................","##########################################",".............................|............","##########################################","..............................|...........","##########################################",".....................................|....","##########################################",".................................|........","##########################################",".........................|................","##########################################",".....................|....................","##########################################","..............|...........................","##########################################","..................|.......................","##########################################","..............|...........................","#########################################S",".......|..................................","##########################################"}

    Returns: 376

  47. {"##########################################","........|.................................","##########################################","................................|.........","##########################################","...........................|..............","##########################################",".................................|........","##########################################",".|........................................","##########################################","...........|..............................","##########################################",".........................................|","##########################################","........|.................................","##########################################","................|.........................","#########################################F","...................................|......","##########################################",".........................|................","##########################################","............|.............................","##########################################","...................|......................","##########################################","......|...................................","##########################################",".............................|............","##########################################","..............................|...........","##########################################",".....................................|....","##########################################",".................................|........","##########################################",".........................|................","##########################################",".....................|....................","##########################################","..............|...........................","##########################################","..................|.......................","##########################################","..............|...........................","#########################################S",".......|..................................","##########################################"}

    Returns: 318

  48. {"##########################################","........|.................................","##########################################","................................|.........","##########################################","...........................|..............","##########################################",".................................|........","##########################################",".|........................................","##########################################","...........|..............................","##########################################",".........................................|","##########################################","........|.................................","##########################################","................|.........................","###########################S##############","...................................|......","##########################################",".........................|................","##########################################","............|.............................","##########################################","...................|......................","##########################################","......|...................................","##########################################",".............................|............","##########################################","..............................|...........","##########################################",".....................................|....","##########################################",".................................|........","##########################################",".........................|................","##########################################",".....................|....................","##########################################","..............|...........................","##########################################","..................|.......................","##########################################","..............|...........................","#####################################F####",".......|..................................","##########################################"}

    Returns: 286

  49. {"##########################################","........|.................................","##########################################","................................|.........","##########################################","...........................|..............","##########################################",".................................|........","##########################################",".|........................................","##########################################","...........|..............................","##########################################",".........................................|","##########################################","........|.................................","##########################################","................|.........................","#F########################################","...................................|......","##########################################",".........................|................","##########################################","............|.............................","##########################################","...................|......................","##########################################","......|...................................","##########################################",".............................|............","##########################################","..............................|...........","##########################################",".....................................|....","##########################################",".................................|........","##########################################",".........................|................","##########################################",".....................|....................","##########################################","..............|...........................","##########################################","..................|.......................","##########################################","..............|...........................","######################S###################",".......|..................................","##########################################"}

    Returns: 336

  50. {"##############################################","........................................|.....","##############################################",".....................................|........","##############################################","............|.................................","F#############################################","............|.................................","##############################################",".|............................................","##############################################","....................................|.........","##############################################","............................................|.","##############################################","................................|.............","##############################################",".......|......................................","##############################################","...|..........................................","##############################################","............................................|.","##############################################",".................|............................","##############################################","....................................|.........","##############################################","......................................|.......","##############################################",".......|......................................","##############################################","................................|.............","##############################################",".................................|............","##############################################","...........................|..................","S#############################################",".............................................|","##############################################","...........................................|..","##############################################","............................|.................","##############################################","...................................|..........","##############################################","..............|...............................","##############################################","..................|...........................","##############################################"}

    Returns: 617

  51. {"##############################################","........................................|.....","##############################################",".....................................|........","##############################################","............|.................................","#############################################F","............|.................................","##############################################",".|............................................","##############################################","....................................|.........","##############################################","............................................|.","##############################################","................................|.............","##############################################",".......|......................................","##############################################","...|..........................................","##############################################","............................................|.","##############################################",".................|............................","##############################################","....................................|.........","##############################################","......................................|.......","##############################################",".......|......................................","##############################################","................................|.............","##############################################",".................................|............","##############################################","...........................|..................","S#############################################",".............................................|","##############################################","...........................................|..","##############################################","............................|.................","##############################################","...................................|..........","##############################################","..............|...............................","##############################################","..................|...........................","##############################################"}

    Returns: 659

  52. {"##############################################","........................................|.....","##############################################",".....................................|........","##############################################","............|.................................","##########################################S###","............|.................................","##############################################",".|............................................","##############################################","....................................|.........","##############################################","............................................|.","##############################################","................................|.............","##############################################",".......|......................................","##############################################","...|..........................................","##############################################","............................................|.","##############################################",".................|............................","##############################################","....................................|.........","##############################################","......................................|.......","##############################################",".......|......................................","##############################################","................................|.............","##############################################",".................................|............","##############################################","...........................|..................","###########################F##################",".............................................|","##############################################","...........................................|..","##############################################","............................|.................","##############################################","...................................|..........","##############################################","..............|...............................","##############################################","..................|...........................","##############################################"}

    Returns: 569

  53. {"##############################################","........................................|.....","##############################################",".....................................|........","##############################################","............|.................................","########################F#####################","............|.................................","##############################################",".|............................................","##############################################","....................................|.........","##############################################","............................................|.","##############################################","................................|.............","##############################################",".......|......................................","##############################################","...|..........................................","##############################################","............................................|.","##############################################",".................|............................","##############################################","....................................|.........","##############################################","......................................|.......","##############################################",".......|......................................","##############################################","................................|.............","##############################################",".................................|............","##############################################","...........................|..................","#######S######################################",".............................................|","##############################################","...........................................|..","##############################################","............................|.................","##############################################","...................................|..........","##############################################","..............|...............................","##############################################","..................|...........................","##############################################"}

    Returns: 603

  54. {"##################################################","..........................................|.......","##################################################",".................|................................","##################################################",".............|....................................","##################################################",".................................|................","##################################################","...........................|......................","##################################################","............................................|.....","##################################################","...................|..............................","##################################################","............................................|.....","##################################################","....|.............................................","##################################################",".....................................|............","##################################################",".....|............................................","##################################################","...........................|......................","##################################################",".................|................................","##################################################","...........................................|......","##################################################","..............................................|...","F#################################################",".............|....................................","##################################################","..................|...............................","##################################################","............|.....................................","##################################################","....................................|.............","##################################################","......................................|...........","##################################################","..........................|.......................","##################################################",".......|..........................................","#################################################S","........................................|.........","##################################################","..................|...............................","##################################################"}

    Returns: 267

  55. {"##################################################","..........................................|.......","##################################################",".................|................................","##################################################",".............|....................................","##################################################",".................................|................","##################################################","...........................|......................","##################################################","............................................|.....","##################################################","...................|..............................","##################################################","............................................|.....","##################################################","....|.............................................","##################################################",".....................................|............","##################################################",".....|............................................","##################################################","...........................|......................","##################################################",".................|................................","##################################################","...........................................|......","##################################################","..............................................|...","#################################################F",".............|....................................","##################################################","..................|...............................","##################################################","............|.....................................","##################################################","....................................|.............","##################################################","......................................|...........","##################################################","..........................|.......................","##################################################",".......|..........................................","#################################################S","........................................|.........","##################################################","..................|...............................","##################################################"}

    Returns: 313

  56. {"##################################################","..........................................|.......","##################################################",".................|................................","##################################################",".............|....................................","##################################################",".................................|................","##################################################","...........................|......................","##################################################","............................................|.....","##################################################","...................|..............................","##################################################","............................................|.....","##################################################","....|.............................................","##################################################",".....................................|............","##################################################",".....|............................................","##################################################","...........................|......................","##################################################",".................|................................","##################################################","...........................................|......","##################################################","..............................................|...","###########################S######################",".............|....................................","##################################################","..................|...............................","##################################################","............|.....................................","##################################################","....................................|.............","##################################################","......................................|...........","##################################################","..........................|.......................","##################################################",".......|..........................................","#############################F####################","........................................|.........","##################################################","..................|...............................","##################################################"}

    Returns: 215

  57. {"##################################################","..........................................|.......","##################################################",".................|................................","##################################################",".............|....................................","##################################################",".................................|................","##################################################","...........................|......................","##################################################","............................................|.....","##################################################","...................|..............................","##################################################","............................................|.....","##################################################","....|.............................................","##################################################",".....................................|............","##################################################",".....|............................................","##################################################","...........................|......................","##################################################",".................|................................","##################################################","...........................................|......","##################################################","..............................................|...","################################################F#",".............|....................................","##################################################","..................|...............................","##################################################","............|.....................................","##################################################","....................................|.............","##################################################","......................................|...........","##################################################","..........................|.......................","##################################################",".......|..........................................","S#################################################","........................................|.........","##################################################","..................|...............................","##################################################"}

    Returns: 241

  58. {"############################################","...........................|................","############################################",".................................|..........","############################################","..............|.............................","############################################","....|.......................................","############################################","..........|.................................","############################################","...|........................................","############################################","......|.....................................","############################################",".|..........................................","############################################",".........|..................................","############################################","..........................|.................","############################################","....................|.......................","F###########################################",".........................|..................","############################################","................................|...........","############################################",".......................|....................","############################################","...................................|........","############################################",".........|..................................","############################################","........................|...................","############################################","....................|.......................","############################################",".................|..........................","############################################","....................................|.......","############################################",".........|..................................","############################################",".......................................|....","############################################","..........|.................................","###########################################S","..........................................|.","############################################"}

    Returns: 514

  59. {"############################################","...........................|................","############################################",".................................|..........","############################################","..............|.............................","############################################","....|.......................................","############################################","..........|.................................","############################################","...|........................................","############################################","......|.....................................","############################################",".|..........................................","############################################",".........|..................................","############################################","..........................|.................","############################################","....................|.......................","###########################################F",".........................|..................","############################################","................................|...........","############################################",".......................|....................","############################################","...................................|........","############################################",".........|..................................","############################################","........................|...................","############################################","....................|.......................","############################################",".................|..........................","############################################","....................................|.......","############################################",".........|..................................","############################################",".......................................|....","############################################","..........|.................................","###########################################S","..........................................|.","############################################"}

    Returns: 500

  60. {"############################################","...........................|................","############################################",".................................|..........","############################################","..............|.............................","############################################","....|.......................................","############################################","..........|.................................","############################################","...|........................................","############################################","......|.....................................","############################################",".|..........................................","############################################",".........|..................................","############################################","..........................|.................","############################################","....................|.......................","########S###################################",".........................|..................","############################################","................................|...........","############################################",".......................|....................","############################################","...................................|........","############################################",".........|..................................","############################################","........................|...................","############################################","....................|.......................","############################################",".................|..........................","############################################","....................................|.......","############################################",".........|..................................","############################################",".......................................|....","############################################","..........|.................................","#####################################F######","..........................................|.","############################################"}

    Returns: 462

  61. {"############################################","...........................|................","############################################",".................................|..........","############################################","..............|.............................","############################################","....|.......................................","############################################","..........|.................................","############################################","...|........................................","############################################","......|.....................................","############################################",".|..........................................","############################################",".........|..................................","############################################","..........................|.................","############################################","....................|.......................","#######################F####################",".........................|..................","############################################","................................|...........","############################################",".......................|....................","############################################","...................................|........","############################################",".........|..................................","############################################","........................|...................","############################################","....................|.......................","############################################",".................|..........................","############################################","....................................|.......","############################################",".........|..................................","############################################",".......................................|....","############################################","..........|.................................","##S#########################################","..........................................|.","############################################"}

    Returns: 418

  62. {"#############################################","..................................|..........","#############################################","......|......................................","#############################################",".................................|...........","#############################################",".......................................|.....","#############################################","|............................................","F############################################",".........................|...................","#############################################","...|.........................................","#############################################","...............................|.............","#############################################","...|.........................................","#############################################","......................|......................","#############################################","................|............................","#############################################","............|................................","#############################################","..............................|..............","#############################################",".........................................|...","#############################################","........................................|....","#############################################","...............|.............................","#############################################","............................................|","#############################################","......................|......................","#############################################","................................|............","#############################################",".....................................|.......","#############################################","........................|....................","#############################################","............|................................","#############################################","...............|.............................","#############################################",".......................|.....................","############################################S"}

    Returns: 677

  63. {"#############################################","..................................|..........","#############################################","......|......................................","#############################################",".................................|...........","#############################################",".......................................|.....","#############################################","|............................................","############################################F",".........................|...................","#############################################","...|.........................................","#############################################","...............................|.............","#############################################","...|.........................................","#############################################","......................|......................","#############################################","................|............................","#############################################","............|................................","#############################################","..............................|..............","#############################################",".........................................|...","#############################################","........................................|....","#############################################","...............|.............................","#############################################","............................................|","#############################################","......................|......................","#############################################","................................|............","#############################################",".....................................|.......","#############################################","........................|....................","#############################################","............|................................","#############################################","...............|.............................","#############################################",".......................|.....................","############################################S"}

    Returns: 665

  64. {"#############################################","..................................|..........","#############################################","......|......................................","#############################################",".................................|...........","#############################################",".......................................|.....","#############################################","|............................................","##########S##################################",".........................|...................","#############################################","...|.........................................","#############################################","...............................|.............","#############################################","...|.........................................","#############################################","......................|......................","#############################################","................|............................","#############################################","............|................................","#############################################","..............................|..............","#############################################",".........................................|...","#############################################","........................................|....","#############################################","...............|.............................","#############################################","............................................|","#############################################","......................|......................","#############################################","................................|............","#############################################",".....................................|.......","#############################################","........................|....................","#############################################","............|................................","#############################################","...............|.............................","#############################################",".......................|.....................","######F######################################"}

    Returns: 611

  65. {"#############################################","..................................|..........","#############################################","......|......................................","#############################################",".................................|...........","#############################################",".......................................|.....","#############################################","|............................................","##########################F##################",".........................|...................","#############################################","...|.........................................","#############################################","...............................|.............","#############################################","...|.........................................","#############################################","......................|......................","#############################################","................|............................","#############################################","............|................................","#############################################","..............................|..............","#############################################",".........................................|...","#############################################","........................................|....","#############################################","...............|.............................","#############################################","............................................|","#############################################","......................|......................","#############################################","................................|............","#############################################",".....................................|.......","#############################################","........................|....................","#############################################","............|................................","#############################################","...............|.............................","#############################################",".......................|.....................","######################S######################"}

    Returns: 589

  66. {"#################################################F","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","S#################################################"}

    Returns: 2522

  67. {"#################################################S","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","##################################################","|.................................................","##################################################",".................................................|","F#################################################"}

    Returns: 2474

  68. {"F###################", "........|...........", "####################", ".........|..........", "####################", ".|..................", "####################", "|...................", "####################", "..............|.....", "####################", "|...................", "####################", ".......|............", "####################", "..............|.....", "####################", "................|...", "####################", "........|...........", "###################S" }

    Returns: 192

  69. {"##################F#", "........|...........", "####################", ".........|..........", "####################", ".|..................", "####################", "|...................", "####################", "..............|.....", "####################", "|...................", "####################", ".......|............", "####################", "..............|.....", "####################", "................|...", "####################", "..........|.........", "##################S#" }

    Returns: 186

  70. {"F", "|", "S" }

    Returns: 3

  71. {"##F############S####", "........|...........", "####################", ".........|..........", "####################", ".|..................", "####################", "|...................", "####################", "..............|.....", "####################", "|...................", "####################", ".......|............", "####################", "..............|.....", "####################", "................|...", "####################", "..........|.........", "####################" }

    Returns: 26

  72. {"###############S####", "........|...........", "####################", ".........|..........", "####################", ".|..................", "####################", "|...................", "####################", "..............|.....", "###############F####", "|...................", "####################", ".......|............", "####################", "..............|.....", "####################", "................|...", "####################", "..........|.........", "####################" }

    Returns: 69


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: