Code Katas #2 – exes-os, fat-fingers, jaden-case, sum-pairs
Code Katas #2 – exes-os, fat-fingers, jaden-case, sum-pairs
Show starts at 1:38
Code from the stream is here: https://github.com/CodingGarden/code-katas/tree/master/episode_002
Suggest Katas for me to solve here: https://github.com/CodingGarden/code-katas/issues/1
Search for more Coding Garden videos here: https://cg-videos.now.sh
View the Coding Garden FAQ here: https://github.com/CodingGardenCommunity/app-wiki/wiki/Frequently-Asked-Questions
stutter every where!! srterrrrer sdsdsd sdds
Show starts at 1:38
i haven’t tested this code on large arrays, but personally i would try to solve the ‘sum-paris’ problem with this code:
const sumPairs = (arr, sum) => {
const L = arr.length;
let smallestRightIdx = L;
let pair = null;
for (let leftIdx = 0; leftIdx < L-1; leftIdx++) {
for (let rightIdx = leftIdx + 1; rightIdx < L; rightIdx++) {
const x = arr[leftIdx];
const y = arr[rightIdx];
if (x + y === sum && rightIdx < smallestRightIdx) {
smallestRightIdx = rightIdx;
pair = [x, y];
}
}
}
return pair;
}
rare hair down cj
capslock + shift + letter = lower case… on the pc… typing "aNother"… meant to be typed as: a, shift + n, o, t, h , e , r. the large pinky typing would result in: capslock, shift + n, o, t, h , e , r. the final result being: nOTHER
Thank you!
one more episode to see the short hair xD
On Windows shift with capslock on makes letters lowercase.
Will keep on watching these, great stuff!
Your kata videos have inspired me to join the codewars site! Thank you for breaking down the problems like you do.
Nice, learning C¤ atm, but I see JavaScript is sijmilar (have done python before)