fizbin

I'm just this guy, you know?

  • he/him

40-ish white guy in tech

posts from @fizbin tagged #balanced string problem

also:

This is another continuation of https://cohost.org/fizbin/post/202670-a-supposed-straightf (programming puzzle about balanced strings) - if you haven't read that, this likely won't make sense, and you might not want to read this until you've tried solving the problem yourself one or more times.

This solution is not in a deliberate esolang, but it almost might as well be.



I know I said that yesterday's post was the last daily post on this problem I'd do for a while, but this isn't a full write-up, just some "tech programmer garble", as someone called these posts on Twitter:

sed -e 'h;:x' -e 's/()//g;s/\[\]//g;s/{}//g;tx' -e '/./d;x'

(That's a filter that will select those lines that represent balanced strings of parentheses, brackets, and braces, and only those lines. It's written to work both on GNU sed and on the more limited BSD sed that OS X ships with)



This is another continuation of https://cohost.org/fizbin/post/202670-a-supposed-straightf (programming puzzle about balanced strings) - if you haven't read that, this likely won't make sense, and you might not want to read this until you've tried solving the problem yourself one or more times.

I'm nearly out of prepared posts on this topic; I'm trying to pick up enough J to do that justice, but that may take weeks. This will be the last daily post on this topic for a bit.