Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,165,302 members, 7,860,744 topics. Date: Friday, 14 June 2024 at 03:27 PM |
Nairaland Forum / Science/Technology / Programming / Coding Challenge For Fun (4629 Views)
A 30 Day Coding Challenge (Python) For BEGINNERS / Monthly Coding Challenge For Developers With Reward January Edition / Monthly Coding Challenge For Developers With Reward (2) (3) (4)
Re: Coding Challenge For Fun by efosky1246(m): 10:20am On Oct 14, 2017 |
young02: Bro this might work but it's quite inefficient.why looping thrice... |
Re: Coding Challenge For Fun by young02(m): 5:49pm On Oct 15, 2017 |
efosky1246: quite inefficient... see as u talk am self... No be for FUN? tsk... If point-and-kill is what u prefer, have it! def counter(word): word = list(word.lower()) for i in word: if (i.isalpha()) or (i.isdigit()): count = word.count(i) if (count > 1): print "{} ={}" %(i,count) while(word.count(i) > 1): word.remove(i) that's all.... code attached...
|
Re: Coding Challenge For Fun by timtoday: 5:42am On Oct 16, 2017 |
edicied: Better than the previous java solution, but if all the character is not in the same case, your solution would fail for entry with same character but different cases I.e lower and upper cases which are supposed to count as same. |
Morfik: For Developing Ajax Web Applications / Text-to-Speech For Nigerian Languages / Api For Jamb, Waec And Neco
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19 |