Given an array of integers as input, find the length of longest series of same numbers in the array. Also print that number. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Given an array of integers as input, find the length of longest series of same numbers in the array. Also print that number.

eg. input array {10,20,20,30,32,32,32,34} expected output Length:3 Number:32

20th Sep 2017, 6:53 AM
Sahil Luthra
Sahil Luthra - avatar
4 Answers
+ 3
@Java Man thank you so much for the ans bro... n the beginning one code you posted, even my favorite too... 😜😜😜
22nd Sep 2017, 1:57 PM
Sahil Luthra
Sahil Luthra - avatar
+ 2
@java man awesome coding bro 👍👍👍
20th Sep 2017, 1:14 PM
Sahil Luthra
Sahil Luthra - avatar
+ 2
@Java_Man hlo bro... i was wondering... 😕😕😕 is there any other method to do this program?
22nd Sep 2017, 8:53 AM
Sahil Luthra
Sahil Luthra - avatar
+ 1
not ryt now... but can we solve this problem without using HashMap?
22nd Sep 2017, 9:11 AM
Sahil Luthra
Sahil Luthra - avatar