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

 

Array-2 > matchUp
prev  |  next  |  chance

Given arrays nums1 and nums2 of the same length, for every element in nums1, consider the corresponding element in nums2 (at the same index). Return the count of the number of times that the two elements differ by 2 or less, but are not equal.


matchUp([1, 2, 3], [2, 3, 10]) → 2
matchUp([1, 2, 3], [2, 3, 5]) → 3
matchUp([1, 2, 3], [2, 3, 3]) → 2

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

public int matchUp(int[] nums1, int[] nums2) { }

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: 242.0

Copyright Nick Parlante 2017 - privacy