Skip to content

Instantly share code, notes, and snippets.

@craftybones
Last active September 13, 2019 15:59
Show Gist options
  • Save craftybones/5b9dd6c3978d6b50d9979f50ea6cd1fc to your computer and use it in GitHub Desktop.
Save craftybones/5b9dd6c3978d6b50d9979f50ea6cd1fc to your computer and use it in GitHub Desktop.

Idiomatic Katas

Implement the following katas in a language of your choice. The objective is to try to find "canonical" or "idiomatic" solutions to the problems

  1. Find max number in nested list of numbers [[1 2] [3 4]]
  2. Validate date
  3. Check if number is prime
  4. Generate a prime number series
  5. Transpose of a matrix
  6. Diagonals of a matrix
  7. Number of days between two dates
  8. Fibonacci series
    • First n fibonacci terms
    • First n even fibonacci terms
    • Only even terms within the first n fibonacci terms
  9. Frequency table of a list
  10. Index of positions of a list
    • Given a list, make a table of each element and all the positions it occurs at
  11. Sum of two lists [1,2] + [3,4]
  12. Express a number in words: 2345 == Two Thousand Three Hundred And Forty Five
  13. Minimum value of one array against another
    • A = [1,2,3,4,5] B = ["a","a","b","a","c"] => {"a":1,"b":3,"c":5}
  14. Check winning conditions for Tic Tac Toe
  15. Classify a poker hand as Full House, Royal Flush etc.
  16. Mean/Median/Mode
  17. Langton's Ant
  18. Conway's Game Of Life
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment