I’d started to get bored of leetcode. I could not bring myself to solve another leetcode problem. After all, it did not serve any higher purpose. I wanted something else to occupy my mind — that is when I came across Jeff Erickson’s book on Algorithms : https://jeffe.cs.illinois.edu/teaching/algorithms/#book

It absolutely blew my mind! This book is clearer and better written than any other algorithm book out there! So friends and algorithm enthusiasts — let’s solve the exercises!

I will be starting a new series of posts on the book — I’m open to discussions and working together while solving the exercises! Let me know!

A string S of lowercase English letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts.

Input s = “ababcbacadefegdehijhklij”;

Output = [9…

Sweta Barman

I’m a software engineer with a strong interest in algorithms. I love solving puzzles and love the aha moment of arriving at a solution after hours of struggle.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store