about | help | code help+videos | done | prefs |
Write a method that accepts the length and width of a grid of X's. Return the number of X's that lie on the border. For exmaple: XXXX XXXX XXXX has 10 X's on the border. Here I have changed the X's on the border to O's: OOOO OXXO OOOO Notice that a 2 by 2 grid of X's is ALL border: XX XX Border marked with O's: OO OO Note that length and width will each be at least one. borderSize(1, 5) → 5 borderSize(3, 1) → 3 borderSize(1203, 1) → 1203 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 240
Copyright Nick Parlante 2017 - privacy