Problem

0 0 0 0 0 0 0 
0 1 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 0 0 1 0
0 0 0 0 0 0 0


Problem

Conditions

  1. has to be done in place ( space-constrained, ie. cannot allocate a new array)
  2. the order of non-zero elements on the right do not matter

Example

Input : arr[] = {0, 1, 2, 5, 0, 3, 0, 3};
Output : arr[] = {0, 0, 0, 2, 1, 3, 3, 5};

Solution

Python

Solve move all zeros to the left of the array in Python

Golang

Solve move all zeros to the left of the array in Golang

Takeaways


Find Tokenized Words in a String

Problem

What are Tokenized Words?

  1. Words without space. For example, abc, def, a, b, c
  2. Quoted words with or without space. For example, “qwerty asd zxcv”, “abc”, “a”

Example 01

  • Input: asd def qwe “qwerty asd zxcv” asf “tyuip dfhgdj fgh”
  • Output: [‘asd’, ‘def’, ‘qwe’, ‘“qwerty asd zxcv”’, ‘asf’…


Problem


Photo by Mike Alonzo on Unsplash

What is Chain of Responsibility?

  • A behavioral design pattern that lets you pass requests along a chain of handlers
  • Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.

Problem


Photo by carlos aranda on Unsplash

Problem


Photo by Jefferson Santos on Unsplash
  • I want to do a Masters program in Cyber Security
  • I believe Singapore University of Technology and Design (SUTD)’s Masters of Science in Security by Design would be a suitable and ideal Masters program that I would want to pursue

Simple Consumer Producer Parallelism using GoRoutines

Why?


https://www.basf.com/sg/en/media/news-releases/asia-pacific/2021/01/basf_caregen_supply_agreement.html


Leonard Yeo

Generalist-Specialist juggling between learning and career development. Educator at https://www.eduelk.com, https://www.linkedin.com/in/leonardyeoxl

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