[ya-day1] tshortChooser solution for base case
This commit is contained in:
@@ -4,5 +4,14 @@ export function tiShortChoser(
|
||||
sBlue: number,
|
||||
sRed: number,
|
||||
) {
|
||||
return [3, 4];
|
||||
let tishort = tBlue > tRed ? tRed + 1 : tBlue + 1;
|
||||
let socks = sBlue > sRed ? sRed + 1 : sBlue + 1;
|
||||
|
||||
if (tBlue === tRed) tishort = tRed + 1;
|
||||
if (sBlue === sRed) socks = sRed + 1;
|
||||
|
||||
if (tBlue === tRed && tBlue === 1) tishort = 2;
|
||||
if (sBlue === sRed && sBlue === 1) socks = 2;
|
||||
|
||||
return [tishort, socks].join(" ");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user