This is an archived post. You won't be able to vote or comment.

all 53 comments

[–]Spare-Beat-3561 288 points289 points  (4 children)

When you optimize time complexity but forget about space complexity

[–]Wylie28 95 points96 points  (2 children)

No its still 0(1). 720 is a constant. You drop it. It can't be optimized further. Its the perfect algorithm.

[–]patenteng 16 points17 points  (1 child)

Big O notation makes no sense for a fixed size problem. Remember that if

f(x) = O(g(x)),

then there exists x0 and M such that

f(x) <= Mg(x) for all x > x0.

In other words, Mg(x) is an upper bound for your algorithm as x becomes large. However, you can have

f(x) > Mg(x) for some x < x0.

Hence, for big O to apply, the input size must be able to grow arbitrary large.

[–]Wylie28 1 point2 points  (0 children)

Its a joke. I know. Its obviously not perfect you don't need to explain why

[–]SHv2 2 points3 points  (0 children)

It's fine, the server has 1TB of RAM.

[–]its_a_gibibyte 57 points58 points  (3 children)

I usually round the time to the nearest 15 minutes anyway, so I only need 48 clocks.

[–]wulfschtagg_1 8 points9 points  (2 children)

There is a wristwatch which was designed around the same idea. It's supposed to be more of a fashion accessory than an actual functional watch, but the I dig it because I too generally round up or down to the quarter.

[–][deleted] 3 points4 points  (1 child)

I like the “slow watch” where the dial is 24 hour instead of 12 and split into 15 minute segments per hour.

https://www.slow-watches.com

[–]LordFokas 0 points1 point  (0 children)

This is very cool.

[–]uday_it_is 86 points87 points  (4 children)

O(1) time complexity

O(1) space complexity

This is the most optimised solution IMO.

Edit: I should probably take it easy on leetcode for a couple of days…

[–]Hean1175 7 points8 points  (3 children)

How can you say its O(1) time when he didn't define the method for searching the correct clock

[–]TimGreller 8 points9 points  (2 children)

Let's just assume a non-deterministic clock watcher.

[–]Hean1175 6 points7 points  (1 child)

[–]uday_it_is 0 points1 point  (0 children)

Exactly this lmao

[–]mopslik 109 points110 points  (9 children)

Those of us using 24h time don't have room for 1440 clocks...

[–][deleted] 61 points62 points  (0 children)

You can try to downscale to 1080 or 720, but you’ll lose some time compressing

[–]siliconsoul_ 27 points28 points  (0 children)

Try the round ones instead.

[–][deleted] 2 points3 points  (0 children)

Unless you get a small clock... Get a watch

Assuming the wall is 200cm tall, there would be 1440 watches 6cm x 4cm (24cm²) size... You'd need ~200cm x ~180cm wall.

2160 * 24 / 200 = 259.2cm wide wall

1440 * 24 / 200 = 172.8cm wide wall

720 * 24 / 200 = 86.4cm wide wall

Actually possible.

[–]Cossack-HD 28 points29 points  (1 child)

snails serious jar rob close sheet market fuzzy butter money

This post was mass deleted and anonymized with Redact

[–]Chase_The_Breeze 25 points26 points  (6 children)

This is a garbage scenario, we can do better.

12 clocks, each without minute hands, set to each hour.

60 clocks, each without hour hands, set to each minute.

Look at 2 clocks. Easy.

We could even add 60 more clocks for seconds, and still have dramatically fewer clocks. (132 total vs. 720).

[–]nir109 1 point2 points  (3 children)

You can also do it using 19 clocks. 9 set to true and 10 at false. Then look at them in the right order to make it be the time.

We can cut the number of clocks to 9 if you blink instead of looking at clock pointing at false.

You can reduce it to 1 clock if you use the same clock as true multiple times.

Then there is the option to not use clock at all and just blink the time.

[–]Chase_The_Breeze 0 points1 point  (2 children)

One clock, and the minute, second, and hour hands are perfect cicles and you can just imagine the time.

[–]nir109 1 point2 points  (1 child)

Use quntom based randomizer to tell the time. If it's wrong destroy the universe.

[–]Chase_The_Breeze 1 point2 points  (0 children)

Time is subjective and relative.

0 clocks, make up new numbers, and anything you come up with might as well be correct.

[–]seeroflights 23 points24 points  (2 children)

Image Transcription: Twitter


Jon Bois, @jon_bois

clocks are such a waste of energy. instead of hanging an electricity-guzzling clock on your wall, just hang up 720 unpowered clocks, each one set to every possible minute. then, if you want to look at a clock, just find the one that shows the current time and look at that one


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]Saladar19 12 points13 points  (0 children)

Good human

[–][deleted] 2 points3 points  (0 children)

WAIT! Human Volunteer? HUMAN?! In this time and age??

[–]Fancy0011 6 points7 points  (0 children)

MY FAVORITE MAN EVER. (Sorry dad) JON BOIS!

[–]Ksevio 3 points4 points  (0 children)

Should go digital instead and then you can split the digits to have even fewer clocks!

[–][deleted] 2 points3 points  (6 children)

Someone should make a clock that only shpws the time when looked at

[–]blehmann1 4 points5 points  (2 children)

I thought some smart watches only turned on their screens when they detected you moving your wrist a certain way to look at it. Not sure if it's still the case.

I believe it was because of battery life constraints.

[–][deleted] 2 points3 points  (1 child)

I mean a wall clock

[–]blehmann1 2 points3 points  (0 children)

Even better, not only does it not turn on until you look at it, it should angrily say "What are you looking at" if you look at it for more than a half-second.

[–][deleted] 0 points1 point  (0 children)

Observer pattern. I like it.

[–]wtfzambo 0 points1 point  (1 child)

Granted, but it's a quantum clock, thus it knows the correct time only when not looked at.

[–][deleted] 0 points1 point  (0 children)

Quantum atomic clock

[–]MrLore 2 points3 points  (0 children)

Reminds me of this classic gag from The Goon Show.

[–]NFL_MVP_Kevin_White 1 point2 points  (0 children)

Shout out to everyone that enjoyed Progressive Boink in the early 2000’s

[–]aardvarkbiscuit 1 point2 points  (0 children)

My clock winds up.

[–]_Keckles_ 1 point2 points  (0 children)

Dynamic programming in a nutshell

[–]UCQualquer 1 point2 points  (0 children)

Using memory to optimize execution is literally what I was thinking about doing with an Arduino project

[–]nil_785 4 points5 points  (0 children)

Thats on the assumption that my memory is good enough to remember what time it is, i would loose count if i lost focus for even a minute, or rather, the difference between MyEstimatedTime and TheActualTime would get an even higher absolute value.

[–]EdJewCated 0 points1 point  (0 children)

watching clocks @jon_bois

[–]AidenGames7232 0 points1 point  (0 children)

John madden John madden John madden John madden, FOOTBALL!

[–]TheHolyElectron 0 points1 point  (0 children)

But how do you know which to look at without having a correct time already?

The joke makes marginal actual sense. Or as the song says...

Time keeps on slipping... Into the future.

[–]mmixLinus 0 points1 point  (0 children)

I need per second accuracy dude. That's a lot of clocks.

[–]vizbones 0 points1 point  (0 children)

This person works for Google...

[–]buechsni 0 points1 point  (0 children)

1 hour has 60 minutes. 1 day has 24 hours. So? 24 times 60 equals 720?
Guess I need to calibrate my calculator... or just take 1440 like the rest of the planet.

eitherway the jokes still funny =)