Advertisement
yimengael

Group words by Shift degree

Apr 21st, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. // Class name must be "Main"
  2. // Libraries included:
  3. // json simple, guava, apache commons lang3, junit, jmock
  4.  
  5. /**
  6. Input: ['abc', 'dog', 'grj', 'bcd', 'eph', 'def', 'apple']
  7. Output: [['abc', 'bcd', 'def'], ['dog', 'grj', 'eph'], ['apple']]
  8.  
  9. ['abc', 'apple', 'bcd', 'def', 'dog', 'eph', 'grj']
  10.  
  11. [abc]
  12. [apple]
  13. [bcd, def]
  14.  
  15. ['abc', 'bcd', 'def', 'dog', 'eph', 'grj'], ['apple']
  16.  
  17. b - a = 1
  18. c - b = 1
  19. abc - (1,1) - "1.1"
  20. bcd - (c - b) = 1, d - c = 1 -> "1.1"
  21.  
  22. {
  23. (1,1) : [abc, bcd..]
  24.  
  25. }
  26. abc, bcd
  27. ascci(a) - ascii(b) = 1
  28. ascci(b) - ascii(c) = 1
  29. ascci(c) - ascii(d) = 1
  30.  
  31.  
  32. ['abc', 'dog', 'grj', 'bcd', 'eph', 'def', 'apple']
  33.  
  34. */
  35.  
  36.  
  37. /**
  38. cnf - dog shifted -1
  39. dog
  40. eph - dog shifted +1
  41. fqi - dog shifted +2
  42. grj - dog shifted +3
  43. */
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement