Ram Prasad

Ram Prasad

  • NA
  • 326
  • 18k

Compare the Array

Apr 16 2019 1:24 PM
Compare two arrays A and B one number at a time. Array A has numbers from 1 to 16 and Array B has number 4,8,12 and 15. one number should be compared at a time. In no match show 0 if matches show number. Next number in B must be compared from next number to the previous match.
Ex- If previous match was at N+3 next comparison must start from N+4 and result should show 0,0,0,4,0,0,0,8,0,0,0,12,0,0,15,0.

Answers (3)