From d2983b355a860af71939a94f5c78d58c61229827 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Sat, 23 May 2026 07:09:27 +0000 Subject: [PATCH] [Sync Iteration] typescript/resistor-color-duo/2 --- .../resistor-color-duo/2/resistor-color-duo.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solutions/typescript/resistor-color-duo/2/resistor-color-duo.ts diff --git a/solutions/typescript/resistor-color-duo/2/resistor-color-duo.ts b/solutions/typescript/resistor-color-duo/2/resistor-color-duo.ts new file mode 100644 index 0000000..b872285 --- /dev/null +++ b/solutions/typescript/resistor-color-duo/2/resistor-color-duo.ts @@ -0,0 +1,16 @@ +export function decodedValue([first, second]:[string, string]):number { + const colourCode: Record= { + "black": 0, + "brown": 1, + "red": 2, + "orange": 3, + "yellow": 4, + "green": 5, + "blue": 6, + "violet": 7, + "grey": 8, + "white": 9 + }; + return colourCode[first]*10 + colourCode[second]; + +}