being my best self, as a software engineer, in the age of the Aquarius

Toni T Diep
3 min readJan 28, 2022

--

WEEKLY RECAP as a software engineering bootcamp graduate: As a software engineer and life-long learner — yes I am owning it! — cultivating an abundance mindset is deeply rooted in self-care that sustains the self in thriving ways — spiritually, mentally, emotionally, physically, and economically. This kind of self-care is an investment of love— that is practiced with trials and errors and extracting such lessons from — i.e. time management and organization. Otherwise, nothing is done.

Maybe this is a mantra? “why are you doing this” reframes the process like a check-in, that is still meaningful yet purposeful to lift any doubt and stagnancy, as a deeper read on our gratitude practice. I am writing this while retrograding planets in the skies are moving forward, surely and soon, in due time.

First, my ‘aha moment’ in researching about any companies can be more effective — it also helps if one is honestly interested in the role, too. At least for myself, by aligning the job description to understanding the company’s business model to products and services — is the ‘aha moment’, in having a clearer overview on two sides of the same coin. This felt overwhelmingly refreshing, especially on entering a different industry — this is part of the inner work. Having discussions with colleagues and friends to also ensure that sleep, happens — seriously. Grind with a purpose…in understanding the ‘why’.

Then with algorithms — I find myself going back to the basics with arrays and sorting them to deeply understand the processes, line by line, per console log’s while tacking on identifying its time complexity.

[Leetcode 832. Flipping an Image] — here we want to flip the image horizontally from the provided ‘n x n’ binary matrix, then invert it, and return the resulting image. Interestingly, another and other solutions approach include inverting the binary matrix ‘image’ first and then horizontally flipping the image. And finally, returning the resulting image.

STEPS TAKEN BELOW:
• A two-pointer approach, we want to set variable ‘final’ = [] to later return the resulting image like this with ‘return final’
• Implemented two for loops providing a time complexity of O(n²)
• Space complexity O(n)

VISUALIZING PROCESS:
Provided Image: [[1,1,0],[1,0,1],[0,0,0]]
Flipping Image: [[0,1,1],[1,0,1],[0,0,0]]Inverted Image: [[1,0,0],[0,1,0],[1,1,1]]Resulting Image: [[1,0,0],[0,1,0],[1,1,1]]Executed in JavaScript:
var flipAndInvertImage = function(image) {
let final = [];
console.log('first loop', final)
for(let i =0; i<image.length; i++){
final.push([]);
console.log('looping process', final)
for(let j=image[i].length-1; j>=0; j--) {
final[i].push(image[i][j] ? 0:1)
}
}
console.log('outside loop', final)
return final
};
With console.log's:
first loop [ [] ]
looping process [ [ 1 ] ]
looping process [ [ 1, 0 ] ]
looping process [ [ 1, 0, 0 ] ]
ending of loop [ [ 1, 0, 0 ] ]
first loop [ [ 1, 0, 0 ], [] ]
looping process [ [ 1, 0, 0 ], [ 0 ] ]
looping process [ [ 1, 0, 0 ], [ 0, 1 ] ]
looping process [ [ 1, 0, 0 ], [ 0, 1, 0 ] ]
ending of loop [ [ 1, 0, 0 ], [ 0, 1, 0 ] ]
first loop [ [ 1, 0, 0 ], [ 0, 1, 0 ], [] ]
looping process [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1 ] ]
looping process [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1 ] ]
looping process [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ]
ending of loop [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ]
outside loop [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 1, 1, 1 ] ]

Thanks for reading — happy coding.

Resources
• litCode. “leetcode-832 Flipping an Image Explanation and Solution”. Youtube.com

--

--

Toni T Diep
Toni T Diep

Written by Toni T Diep

multilingual Software Engineer, always learning and growing.

Responses (2)