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

 

logic_closeOrFarN


Given an integer array called list, return "close" if any two values in the array are duplicates or differ by 1. Return "far" if no values in the array are the same or differ by 1.


logic_closeOrFarN([1, 2, 3, 4, 5]) → "close"
logic_closeOrFarN([1, 3, 6, 9, 0]) → "close"
logic_closeOrFarN([3, 5, 6, 8, 10]) → "close"

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

public String logic_closeOrFarN(int[] list) { }

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