Question #1

Question:

Write a standalone script or function that compresses a string based on the count of contiguous letters. For example, given abbcccdddd, the function will return, ab2c3d4.

Solution: PENDING

~rs

more ...

Python Finite State Machines

Check this short but sweet non-deterministic Finite State Machine Function that simply accepts a FSM and returns a string if it is not ambiguous!

The idea is as follows:

  • Take an edge if it has not already been visited, otherwise go to the next edge.
  • If current state is final ...
more ...

Quick Intro to regular expressions with Python

I recently had to use quite a lot of parsing in Python for work-related stuff, so I've been looking at what are some of the best ways to be able to parse patterns and the answer is of course, regular expressions! (I use Python because I feel more comfortable ...

more ...