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

 

gaurav.gupta@mq.edu.au arrays > nemesisInTheHouse
prev  |  next  |  chance

Define a function that when passed an array, returns,
- true, if each item has its negated value (6 and -6 are mutual negatives, for example), and,
- false, otherwise.
You may add helper function(s).


nemesisInTheHouse([6, -6, -6]) → true
nemesisInTheHouse([0, 0, -5, 8, 3, 5, 5, -8, 8, 8, 8, -8]) → false
nemesisInTheHouse([-3, 0, 0, -5, 8, 3, 5, 5, -8, 8, 8, 8, -8, -3]) → true

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

boolean nemesisInTheHouse(int[] data) { }

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: 4 Post-solution available

Copyright Nick Parlante 2017 - privacy