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

 

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

A is said to be a subset of B if, every item in A occurs in B at least as many times as it occurs in A. Define a function that when passed two integer arrays, returns true if the first array is a subset of the second array.


isSubsetOf([20, 10], [10, 70, 20, 90]) → true
isSubsetOf([20, 20], [10, 70, 20, 90]) → false
isSubsetOf([10, 70, 20, 90], [20]) → false

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

boolean isSubsetOf(int[] a, int[] b) { }

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

Copyright Nick Parlante 2017 - privacy