+ 1
Linked list java
how to "combine" same value in array, sum the same value by 1 then remove the second same value until no same value appear. ex : arr{1,1,4,5} result = {2,4,5} // 1+1 , then remove second value arr{1,1,2} result ={3}//1+1={2,2} -> same value 2+1= {3} remove the second value again. what should method linked list array i use?
4 Respuestas
+ 2
https://code.sololearn.com/cFC6oCRPZgVC
try this... still not perfect though just giving you an idea :D
0
There is currently no method that combine two values from an array. But you can create an algorithm for it.
0
so any clue to solve it?
0
thx a lot