Skip to content

Instantly share code, notes, and snippets.

View Rafailong's full-sized avatar
🤠

ravila Rafailong

🤠
  • Mexico
View GitHub Profile
(*
Atbash Cipher
The Atbash Cipher is simple: replace every letter with its “mirror” in the alphabet.
A is replaced by Z. B is replaced by Y. Etc. Write a function to calculate it.
Examples
(atbash "") ;=> ""
(atbash "hello") ;=> "svool"
@Rafailong
Rafailong / balanced_paren_cluster.worksheet.sc
Created November 16, 2021 20:17
Balanced Paren Clusters
import $scalac.`-Ypartial-unification`
import $dep.`org.typelevel::cats-core:2.3.0`
import scala.collection.immutable._
import cats.Foldable
import cats.implicits._
/**
* Balanced Paren Clusters
/**
* Given two words, we can determine if they have the same vowels,
* ignoring order and repetition.
*
* For instance, “Hello” and “Vowel” both have \e and \o, so they have the same vowels.
*
* Write a function that groups words into “families” that all have the same vowels.
* “Tree” and “tent” also belong to the same family because we ignore the repetition of \e.
*
* Examples
version = "3.5.3"
maxColumn = 100
runner.dialect = scala3
style = defaultWithAlign
align.openParenCallSite = false
align.openParenDefnSite = false
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
spaces.inImportCurlyBraces = false
project.excludeFilters = [".*\\.sbt"]