about | help | code help+videos | done | prefs |
public boolean sameFirstLast2(int[] nums)
public boolean sameFirstLast2(int[] nums) { boolean same = false; int len = nums.length; if (nums[0] == nums[len-1]) { same = true; } return same; } sameFirstLast2([1, 4, 5, 6, 7, 4, 1]) → true sameFirstLast2([6, 7, 1, 2, 3, 8, 6]) → true sameFirstLast2([1, 2, 10, 11, 12, 3, 4]) → false ...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: 1
Copyright Nick Parlante 2017 - privacy