r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

1

u/luciusplc May 10 '15 edited May 10 '15

I did thought experiment by trying to find counter example for hypothetical two strings and realised it's impossible. It's hard to explain. I assumed one is pattern repetition (the most painful) of the second like 543, 543543++X, Y and X,Y are things i messed with to spoil transitivity. And i realised that there is no way. Yea... brute-force radix in mind. Happily i limited myself to things: "digit bigger/equal/lesser than ...". So you can consider this as spanning tree of logical posibilities. It's much easier to think this way than write it down. I don't mind if you call it guesswork and I agree that formal proofs are far superior.

3

u/[deleted] May 11 '15

Aha, in other words, it might not be completely intuitive. Here is my writeup and solution: https://bjart.li/programming-problem-maxconcat/