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

 

jebbert@volusia.k12.fl.us > test2025_05_22_APP1SL_duplicates
prev  |  next  |  chance

Write a method that returns a string with a list of any of the indices where the same number appears in both arrays at the same position. Note that 'list1' and 'list2' can be different lengths. If there are no duplicates, return "no duplicates". Look at the test data for examples.


test2025_05_22_APP1SL_duplicates([32, 47, 214, 54, 251, 84, 241, 45, 7, 2, 3, 32, 214, 68, 54, 643, 124, 84, 7, 5], [84, 32, 2, 214]) → "no duplicates"
test2025_05_22_APP1SL_duplicates([7, 5, 3, 1, 8, 12, 53], [53, 12, 7, 5, 3, 1, 8]) → "no duplicates"
test2025_05_22_APP1SL_duplicates([5, 5, 5, 5, 23, 40], [23, 5, 7, 8, 22, 5, 5, 5]) → "duplicates at 1"

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

public String test2025_05_22_APP1SL_duplicates(int[] list1, int[] list2) { }

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

Copyright Nick Parlante 2017 - privacy