forgot password | create account
Or use
about | help | code help+videos | done | prefs
CodingBat code practice


AP-1 > wordsWithout
prev  |  next  |  chance

Given an array of strings, return a new array without the strings that are equal to the target string. One approach is to count the occurrences of the target string, make a new array of the correct length, and then copy over the correct strings.

wordsWithout(["a", "b", "c", "a"], "a") → ["b", "c"]
wordsWithout(["a", "b", "c", "a"], "b") → ["a", "c", "a"]
wordsWithout(["a", "b", "c", "a"], "c") → ["a", "b", "a"]

...Save, Compile, Run

public String[] wordsWithout(String[] words, String target) { }

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 2016 - privacy