JavaScript - Convert Boolean Values to Strings Yes or No | CodeWars 8KYU

  Рет қаралды 178

Wrt Tech

Wrt Tech

Күн бұрын

Пікірлер: 4
@juanrolon1729
@juanrolon1729 Жыл бұрын
Really good solution! I struggled a bit with these one, I couldnt get all the tests to pass. Your solution was pretty elegant, but I wonder how good is the performance of that algorithm, are there any alternatives?
@wrttech422
@wrttech422 Жыл бұрын
Since the function's behavior and execution time do not depend on the size of the input or involve any loops or recursive calls, the time complexity can be considered constant O(1). It will always execute in the same amount of time, regardless of the input. As for alternatives, there are probably a lot, but im pretty sure that this is the least amount of code possible. Another popular way would be an if else statement, but it would have a few more lines of code. Time complexity would be the same though.
@juanrolon1729
@juanrolon1729 Жыл бұрын
@@wrttech422 do you believe this solution would scale well if containerized like in docker or something or it cant handle concurrency?
@wrttech422
@wrttech422 Жыл бұрын
That really depends on the infrastructure and architecture of the system. This function runs in O(1) which is the fastest possible time complexity. You can still run into issues, such as race conditions, with the most efficient function in the world.
String slicing in JavaScript ✂️【3 minutes】
3:55
Bro Code
Рет қаралды 24 М.
Logical operators in Python are easy 🔣
5:04
Bro Code
Рет қаралды 113 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 322 М.
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 649 М.
I made Tetris in C, this is what I learned
15:15
Austin Larsen
Рет қаралды 30 М.
Is THIS Python's MOST Underrated Operator? (Walrus Operator)
5:45
"Clean" Code, Horrible Performance
22:41
Molly Rocket
Рет қаралды 946 М.
Zig for Impatient Devs
9:48
Isaac Harris-Holt
Рет қаралды 125 М.
JavaScript - Exes and Ohs | Codewars 7KYU
3:52
Wrt Tech
Рет қаралды 220
How to Use Codewars Platform
13:03
AltCampus
Рет қаралды 29 М.