id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > distanceAround
prev  |  next  |  chance

For this method, pass in an array of positive integers that are either in increasing or decreasing order. The array will have at least one such number. Each number in the array tells you how many 1 by 1 squares are in that row. Each number is a new row. Return the total PERIMETER of the resulting region.


distanceAround([3, 5, 6]) → 18
distanceAround([43]) → 88
distanceAround([50, 7, 1]) → 106

...Save, Compile, Run (ctrl-enter)

public int distanceAround(int[] widths) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 440

Copyright Nick Parlante 2017 - privacy