/ISSUE-3/README.md

https://github.com/piliwilliam0306/WPC · Markdown · 57 lines · 34 code · 23 blank · 0 comment · 0 complexity · 5033770885fb0ed72991796e54a28fa9 MD5 · raw file

  1. ISSUE#3 - Unique substring
  2. ===
  3. Problem:
  4. Let’s have N different strings/words for each word print the minimum part of it which makes it unique toward others, for example:
  5. input:
  6. A13-OLinuXino
  7. iMX233-OLinuXino
  8. MOD-PULSE
  9. MOD-IO
  10. <end>
  11. result:
  12. A13-OLinuXino -> a
  13. iMX233-OLinuXino -> 2
  14. MOD-PULSE -> p
  15. MOD-IO -> -i
  16. i.e. if you search for “a” in all words you will find it only in “A13-OLinuXino”, if you search for “2” in all words you will find it only in “iMX233-OLinuXino” and so on.
  17. Solutions:
  18. ==
  19. 1. Dylan, Python - works, received 26 minutes after the problem post, and one of smallest too just 10 rows solve the problem
  20. 2. Zokier, Python - works, very small and compact code
  21. 3. Davide Silvestri, Python - works, clean and commented code
  22. 4. Mateusz Klatecki, C - works, I admire everyone who works with strings in C ;-)
  23. 5. Hanspeter Portner, Lua
  24. 6. Mikhail Soloviev, C++
  25. 7. Antal Koos, Python - works in both case sensetive and case insensetive
  26. 8. Piotr Gapinski, AWK - "$ gawk -f olimex.awk input" most exotic solution
  27. 9. Francesco Frassinelli, Python - another small and clean solution
  28. 10. Lukasz Pulka, Python - mix python/c
  29. 11. Diego Roversi, Python
  30. 12. Miller Wang, C
  31. 13. Johannes Lummel, PureBasic
  32. 14. Petr Konecny, Python - another small and clean solutiion
  33. 15. Emilio Lopez, Python
  34. 16. Bogdan Marinescu, Lua - interesting approach to work with numbers instead strings at start