Skip to content

Latest commit

 

History

History
148 lines (96 loc) · 4.53 KB

README.md

File metadata and controls

148 lines (96 loc) · 4.53 KB

challenges

Various algorithmic challenges solutions (rather unstructured).

The file name relevant to the challenge is usually an abbreviation from the challenge title. Some include built-in pytest cases, other require to be run with a test input file (name convention includes the *.py file name with _test_*.txt ending ).

All below has been done ad-hoc during few months period of time for self-entertaining purpose, so each file is a self-contained mini-program. They are mostly Python3.7, but there might be few old crafted with Python2.7 manner. It could be that some include some notes, "alternative" versions of the code, commented blocks or other random bits. I treat this as a personal archive - not a thing to show off.

General challenges:

  1. Dijakstra's

HackerRank challenges:

  1. Mark and Toys https://www.hackerrank.com/challenges/mark-and-toys

  2. Fraudulent Activity Notifications https://www.hackerrank.com/challenges/fraudulent-activity-notifications

  3. Making Candies * https://www.hackerrank.com/challenges/making-candies

  4. Merge Sort: Counting Inversions * https://www.hackerrank.com/challenges/ctci-merge-sort

  5. Friend Circle Queries https://www.hackerrank.com/challenges/friend-circle-queries

  6. Frequency Queries https://www.hackerrank.com/challenges/frequency-queries

  7. New Year Chaos https://www.hackerrank.com/challenges/new-year-chaos

  8. Trees: Is This a Binary Search Tree? https://www.hackerrank.com/challenges/ctci-is-binary-search-tree

  9. Tree: Height of a Binary Tree https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree

  10. Count Triplets https://www.hackerrank.com/challenges/count-triplets-1

  11. Two Strings https://www.hackerrank.com/challenges/two-strings

  12. Hash Tables: Ransom Note https://www.hackerrank.com/challenges/ctci-ransom-note

  13. 2D Array - DS https://www.hackerrank.com/challenges/2d-array

  14. BFS: Shortest Reach in a Graph https://www.hackerrank.com/challenges/ctci-bfs-shortest-reach

  15. DFS: Connected Cell in a Grid https://www.hackerrank.com/challenges/ctci-connected-cell-in-a-grid

  16. Roads and Libraries https://www.hackerrank.com/challenges/torque-and-development

  17. Maximum Xor https://www.hackerrank.com/challenges/maximum-xor

  18. Flipping bits https://www.hackerrank.com/challenges/flipping-bits

  19. Time Complexity: Primality https://www.hackerrank.com/challenges/ctci-big-o

  20. [time-out] Time Complexity: Primality https://www.hackerrank.com/challenges/ctci-big-o

  21. Linked Lists: Detect a Cycle https://www.hackerrank.com/challenges/ctci-linked-list-cycle

  22. Recursion: Davis' Staircase https://www.hackerrank.com/challenges/ctci-recursive-staircase

  23. Recursion: Fibonacci Numbers https://www.hackerrank.com/challenges/ctci-fibonacci-numbers

  24. Minimum Swaps 2 https://www.hackerrank.com/challenges/minimum-swaps-2

  25. Array Manipulation https://www.hackerrank.com/challenges/crush

  26. Swap Nodes https://www.hackerrank.com/challenges/swap-nodes-algo

  27. Queues: A Tale of Two Stacks https://www.hackerrank.com/challenges/ctci-queue-using-two-stacks

  28. Balanced Brackets https://www.hackerrank.com/challenges/balanced-brackets

  29. Luck Balance https://www.hackerrank.com/challenges/luck-balance

  30. Abbreviation https://www.hackerrank.com/challenges/abbr

  31. Common Child https://www.hackerrank.com/challenges/common-child

  32. Sherlock and the Valid String https://www.hackerrank.com/challenges/sherlock-and-valid-string

  33. Game of Thrones - I https://www.hackerrank.com/challenges/game-of-thrones

  34. The Love-Letter Mystery https://www.hackerrank.com/challenges/the-love-letter-mystery

  35. Merge Sort: Counting Inversions * https://www.hackerrank.com/challenges/ctci-merge-sort

  36. Sorting: Comparator https://www.hackerrank.com/challenges/ctci-comparator-sorting

  37. Alternating Characters https://www.hackerrank.com/challenges/alternating-characters

  38. Arrays: Left Rotation https://www.hackerrank.com/challenges/ctci-array-left-rotation

  39. Sherlock and Anagrams https://www.hackerrank.com/challenges/sherlock-and-anagrams

  40. New Year Chaos https://www.hackerrank.com/challenges/new-year-chaos

  41. Repeated String https://www.hackerrank.com/challenges/repeated-string

  42. Jumping on the Clouds https://www.hackerrank.com/challenges/jumping-on-the-clouds

  43. Counting Valleys https://www.hackerrank.com/challenges/counting-valleys

  44. Sock Merchant https://www.hackerrank.com/challenges/sock-merchant

(*) marked solutions time-out with Python3 at HackerRank, but some of them pass with CPython selected or Pypy. It's a "popular problem" with HackerRank submissions for Python3.