Jump to content

Recommended Posts

Posted
nenu ekkada thappu chesaaano cheppandi boss... eee function submit chesthey mee peru cheppu oka Case corona thaagutha...
 
function(  array<string> , string)
 
{
 
for Example: function (a[], "rajesh")
 
step 1:  Remove all "rajesh" elements if there are any in array a[]
 
step 2: then , among remaining elements , We need top 5 elements depending on their repititions 
 
}
 
 
step 1 working.. step 2 lo error undhi...
 
 
 
 public List<String> evaluate(ArrayList<String> list,Text text) {
 String product= text.toString();
 
 List<String> productList = new ArrayList<String>(); 
 for(String str : list)
 {
 if(!(product.equals(str)))
 {
productList.add(str);
 }
 }
return productList;
 
  }
  
  public ArrayList<String> findTop(ArrayList<String> list) { 
  
  Map<String, Integer> occurrences = new HashMap<String, Integer>();
 
  for ( String word : splitWords ) {
     Integer oldCount = occurrences.get(word);
     if ( oldCount == null ) {
        oldCount = 0;
     }
     occurrences.put(word, oldCount + 1);
  }
 
}

 

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • tejak123

    12

  • god father

    8

  • TOM_BHAYYA

    7

  • fake_Bezawada

    4

Popular Days

Top Posters In This Topic

Posted

ltt .

 

 

karthik calling karthik....

Posted

nenu morning nunchi kottting deeeni kosam.. manchi expert digithe 10 minutes lo ayipothadhi

Posted

nenu morning nunchi kottting deeeni kosam.. manchi expert digithe 10 minutes lo ayipothadhi

 

 

hashmap vadi try cheyyaka poyava 2nd step kosam

 

once a hashmap create ayyaka ee link choodu  

Posted

hashmap vadi try cheyyaka poyava 2nd step kosam

 

once a hashmap create ayyaka ee link choodu  

../////
 
 
link .?
Posted

calling CJ ani oka thread eyyi...lekapothe pakka db lo CJ vuntaadu...oka callin thread eyyi akkada

Posted

 

 

 

 

http://javasimplestu...-on-values.html.//

 

 

Raledhu bro

 

 

 

emi raledu?!!

 

naku actually ne requirement sarigga artham kaledu but correct me if i understood wrong.

 

nee list lo unna words ni evi maximum repeat ayyayo 1st ravali and there on next maximum etc anthe na?!!!

 

 

take a hashmap put the string in key counter in value.

 

then follow the link and you do not need to use the comparator as int is comparable

Posted

emi raledu?!!

 

naku actually ne requirement sarigga artham kaledu but correct me if i understood wrong.

 

nee list lo unna words ni evi maximum repeat ayyayo 1st ravali and there on next maximum etc anthe na?!!!

 

 

take a hashmap put the string in key counter in value.

 

then follow the link and you do not need to use the comparator as int is comparable...

you got it correct ..

this function has two arguments.. one string and one array

Step 1:  first ah array lo nunchi ..ichina string theeeseyyali..  ITS DONE AND WORKING

tharuvatha .. migatha vaatilo max 5 repititions ... IKKADA PROB

Posted

 

emi raledu?!!

 

naku actually ne requirement sarigga artham kaledu but correct me if i understood wrong.

 

nee list lo unna words ni evi maximum repeat ayyayo 1st ravali and there on next maximum etc anthe na?!!!

 

 

take a hashmap put the string in key counter in value.

 

then follow the link and you do not need to use the comparator as int is comparable...

you got it correct ..

this function has two arguments.. one string and one array

Step 1:  first ah array lo nunchi ..ichina string theeeseyyali..  ITS DONE AND WORKING

tharuvatha .. migatha vaatilo max 5 repititions ... IKKADA PROB

 

 

 

sare aithe prethi word ki counter pettuko word encounter ayinappudalla dani counter increment chesi hashmap lo pettu 

 

antha ayi poyaka list iterate chese tappudu hashmap nunchi dani counter techuko if >5 aithe delete chesi counter update chesuko hashmap lo and a word ni list lo nunchi delete cheyyi

Posted

ah blog nadheeeeee

 

 

:P requirement naku sarigga ardam kala but cheppe lepedham tondargaa

×
×
  • Create New...