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

 

amjadm@miamioh.edu arrays > hasSymmetry
prev  |  next  |  chance

Return true if the given array has symmetry. Here, symmetry means the first element is equal to the last element, the second element is equal to the second-to-last element, and so on, all the way to the middle of the array. Arrays with fewer than two elements have symmetry.


hasSymmetry([1, 4, 6, 4, 1]) → true
hasSymmetry([23, 8, 8, 23]) → true
hasSymmetry([1, 1, 1, 2, 1]) → false

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

boolean hasSymmetry(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: 205

Copyright Nick Parlante 2017 - privacy