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

 

simona1@sfusd.edu morearraylist > isEverywhereList
prev  |  next  |  chance

We'll say that a value is "everywhere" in an ArrayList if for every pair of adjacent elements in the ArrayList, at least one of the pair is that value. Return true if the given value is everywhere in the ArrayList.


isEverywhereList([1, 2, 1, 3], 1) → true
isEverywhereList([1, 2, 1, 3], 2) → false
isEverywhereList([1, 2, 1, 3, 4], 1) → false

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

public boolean isEverywhereList(ArrayList <Integer> nums, int val) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy