brithead
01-29-2009, 02:23 AM
Hey I have to do this hw for comp science ive been working on this problem for quite a while but have 2 errors and dont know how to fix it
The link to my work is
http://javabat.com/prob?id=1189766
and here is the question...
Given an array of ints, return true if the array is length 1 or more, and the first element and the last element are the same.
sameFirstLast({1, 2, 3}) → false
sameFirstLast({1, 2, 3, 1}) → true
sameFirstLast({1, 2, 1}) → true
The link to my work is
http://javabat.com/prob?id=1189766
and here is the question...
Given an array of ints, return true if the array is length 1 or more, and the first element and the last element are the same.
sameFirstLast({1, 2, 3}) → false
sameFirstLast({1, 2, 3, 1}) → true
sameFirstLast({1, 2, 1}) → true