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

 

srp4379@lausd.net quiz2 > sumNotOnes
prev  |  next  |  chance

public int sumNoOnes(int[] nums). Given an array of integers, return the sum of all of the numbers that are NOT equal to 1 and that are NOT next to a 1.


sumNotOnes([1, 1, 1, 1]) → 0
sumNotOnes([1, 2, 3, 2, 1]) → 3
sumNotOnes([2, 1, 3, 4, 1, 6, 7, 1, 8]) → 0

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

public int sumNotOnes(int[] nums) { }

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

Copyright Nick Parlante 2017 - privacy