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

 

amjadm@miamioh.edu arrays > targetPair
prev  |  next  |  chance

Given an array, are there 2 side-by-side numbers that add up to the specified target?


targetPair([3, 4, 7], 11) → true
targetPair([-3, 3], 0) → true
targetPair([1, 2, 8, 20], 21) → false

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

boolean targetPair(int[] nums, int target) { }

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

Copyright Nick Parlante 2017 - privacy