Notes like E#, F and C#, Db are definitely not the same due to enharmonics. They only equate to the same frequency under equal temperament.
E#, F
C#, Db
This is a duplicate of https://www.codewars.com/kata/579f54c672292dc1a20001bd
Lacks random tests
You will be given a root note as a string,
So perhaps the parameter to the function should be called root instead of chord
root
chord
Tests could easily force an O(n) instead of O(n²) solution.
O(n)
O(n²)
(I was lazy myself; I was a bit disappointed it passed the tests.)
Loading collection data...
Notes like
E#, F
andC#, Db
are definitely not the same due to enharmonics. They only equate to the same frequency under equal temperament.This is a duplicate of https://www.codewars.com/kata/579f54c672292dc1a20001bd
Lacks random tests
So perhaps the parameter to the function should be called
root
instead ofchord
Tests could easily force an
O(n)
instead ofO(n²)
solution.(I was lazy myself; I was a bit disappointed it passed the tests.)