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

 

srp4379@lausd.net quiz > firstLastEqualsDoubleMiddle
prev  |  next  |  chance

boolean firstLastEqualsDoubleMiddle(int[] nums). Given an array of ints which has an odd length, return true if the sum of the first and last elements equals twice the value of the middle element.


firstLastEqualsDoubleMiddle([1, 1, 1]) → true
firstLastEqualsDoubleMiddle([8, 7, 6]) → true
firstLastEqualsDoubleMiddle([10, 20, 30, 40, 50]) → true

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

boolean firstLastEqualsDoubleMiddle(int[] nums) { }

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: 105

Copyright Nick Parlante 2017 - privacy