From fdda4776fc873fcd1c5ba69bd52b3b66c605fd94 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:02:16 +0000 Subject: [PATCH] [Sync Iteration] typescript/resistor-color-duo/1 --- .../resistor-color-duo/1/resistor-color-duo.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solutions/typescript/resistor-color-duo/1/resistor-color-duo.ts diff --git a/solutions/typescript/resistor-color-duo/1/resistor-color-duo.ts b/solutions/typescript/resistor-color-duo/1/resistor-color-duo.ts new file mode 100644 index 0000000..dfab5a5 --- /dev/null +++ b/solutions/typescript/resistor-color-duo/1/resistor-color-duo.ts @@ -0,0 +1,16 @@ +export function decodedValue(colors:string[]):number { + const colourCode: {[key:string]:number}= { + "black": 0, + "brown": 1, + "red": 2, + "orange": 3, + "yellow": 4, + "green": 5, + "blue": 6, + "violet": 7, + "grey": 8, + "white": 9 + }; + return colourCode[colors[0]]*10 + colourCode[colors[1]]; + +}